Commit 42436eb0 authored by 单奇雲's avatar 单奇雲

点坐标绑定

parent 5173460a
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# ļ:03.06.2020 11:50:46
newmtl fireEquip
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5880 0.5880 0.5880
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka fireEquip.png
map_Kd fireEquip.png
map_d fireEquip.png
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# ļ:03.06.2020 11:50:46
mtllib fireEquip.mtl
#
# object fireEquip
#
v -1.6371 -0.5656 0.0000
v -0.8185 -0.5656 0.0000
v -0.8185 0.3553 0.0000
v -1.6371 0.3553 0.0000
v 0.0000 -0.5656 0.0000
v 0.0000 0.3553 0.0000
v 0.8185 -0.5656 0.0000
v 0.8185 0.3553 0.0000
v 1.6371 -0.5656 0.0000
v 1.6371 0.3553 0.0000
v -0.8185 1.2761 0.0000
v -1.6371 1.2761 0.0000
v 0.0000 1.2761 0.0000
v 0.8185 1.2761 0.0000
v 1.6371 1.2761 0.0000
v -0.8185 2.1970 0.0000
v -1.6371 2.1970 0.0000
v 0.0000 2.1970 0.0000
v 0.8185 2.1970 0.0000
v 1.6371 2.1970 0.0000
v -0.8185 3.1178 0.0000
v -1.6371 3.1178 0.0000
v 0.0000 3.1178 0.0000
v 0.8185 3.1178 0.0000
v 1.6371 3.1178 0.0000
# 25 vertices
vn 0.0000 -0.0000 1.0000
# 1 vertex normals
vt 0.0000 0.0000 0.0000
vt 0.2500 0.0000 0.0000
vt 0.2500 0.2500 0.0000
vt 0.0000 0.2500 0.0000
vt 0.5000 0.0000 0.0000
vt 0.5000 0.2500 0.0000
vt 0.7500 0.0000 0.0000
vt 0.7500 0.2500 0.0000
vt 1.0000 0.0000 0.0000
vt 1.0000 0.2500 0.0000
vt 0.2500 0.5000 0.0000
vt 0.0000 0.5000 0.0000
vt 0.5000 0.5000 0.0000
vt 0.7500 0.5000 0.0000
vt 1.0000 0.5000 0.0000
vt 0.2500 0.7500 0.0000
vt 0.0000 0.7500 0.0000
vt 0.5000 0.7500 0.0000
vt 0.7500 0.7500 0.0000
vt 1.0000 0.7500 0.0000
vt 0.2500 1.0000 0.0000
vt 0.0000 1.0000 0.0000
vt 0.5000 1.0000 0.0000
vt 0.7500 1.0000 0.0000
vt 1.0000 1.0000 0.0000
# 25 texture coords
g fireEquip
usemtl fireEquip
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 2/2/1 5/5/1 6/6/1 3/3/1
f 5/5/1 7/7/1 8/8/1 6/6/1
f 7/7/1 9/9/1 10/10/1 8/8/1
f 4/4/1 3/3/1 11/11/1 12/12/1
f 3/3/1 6/6/1 13/13/1 11/11/1
f 6/6/1 8/8/1 14/14/1 13/13/1
f 8/8/1 10/10/1 15/15/1 14/14/1
f 12/12/1 11/11/1 16/16/1 17/17/1
f 11/11/1 13/13/1 18/18/1 16/16/1
f 13/13/1 14/14/1 19/19/1 18/18/1
f 14/14/1 15/15/1 20/20/1 19/19/1
f 17/17/1 16/16/1 21/21/1 22/22/1
f 16/16/1 18/18/1 23/23/1 21/21/1
f 18/18/1 19/19/1 24/24/1 23/23/1
f 19/19/1 20/20/1 25/25/1 24/24/1
# 16 polygons
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# ļ:03.06.2020 11:52:49
newmtl fireFoam
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5880 0.5880 0.5880
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka fireFoam.png
map_Kd fireFoam.png
map_d fireFoam.png
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# ļ:03.06.2020 11:52:49
mtllib fireFoam.mtl
#
# object fireFoam
#
v -1.6371 -0.5656 0.0000
v -0.8185 -0.5656 0.0000
v -0.8185 0.3553 0.0000
v -1.6371 0.3553 0.0000
v 0.0000 -0.5656 0.0000
v 0.0000 0.3553 0.0000
v 0.8185 -0.5656 0.0000
v 0.8185 0.3553 0.0000
v 1.6371 -0.5656 0.0000
v 1.6371 0.3553 0.0000
v -0.8185 1.2761 0.0000
v -1.6371 1.2761 0.0000
v 0.0000 1.2761 0.0000
v 0.8185 1.2761 0.0000
v 1.6371 1.2761 0.0000
v -0.8185 2.1970 0.0000
v -1.6371 2.1970 0.0000
v 0.0000 2.1970 0.0000
v 0.8185 2.1970 0.0000
v 1.6371 2.1970 0.0000
v -0.8185 3.1178 0.0000
v -1.6371 3.1178 0.0000
v 0.0000 3.1178 0.0000
v 0.8185 3.1178 0.0000
v 1.6371 3.1178 0.0000
# 25 vertices
vn 0.0000 -0.0000 1.0000
# 1 vertex normals
vt 0.0000 0.0000 0.0000
vt 0.2500 0.0000 0.0000
vt 0.2500 0.2500 0.0000
vt 0.0000 0.2500 0.0000
vt 0.5000 0.0000 0.0000
vt 0.5000 0.2500 0.0000
vt 0.7500 0.0000 0.0000
vt 0.7500 0.2500 0.0000
vt 1.0000 0.0000 0.0000
vt 1.0000 0.2500 0.0000
vt 0.2500 0.5000 0.0000
vt 0.0000 0.5000 0.0000
vt 0.5000 0.5000 0.0000
vt 0.7500 0.5000 0.0000
vt 1.0000 0.5000 0.0000
vt 0.2500 0.7500 0.0000
vt 0.0000 0.7500 0.0000
vt 0.5000 0.7500 0.0000
vt 0.7500 0.7500 0.0000
vt 1.0000 0.7500 0.0000
vt 0.2500 1.0000 0.0000
vt 0.0000 1.0000 0.0000
vt 0.5000 1.0000 0.0000
vt 0.7500 1.0000 0.0000
vt 1.0000 1.0000 0.0000
# 25 texture coords
g fireFoam
usemtl fireFoam
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 2/2/1 5/5/1 6/6/1 3/3/1
f 5/5/1 7/7/1 8/8/1 6/6/1
f 7/7/1 9/9/1 10/10/1 8/8/1
f 4/4/1 3/3/1 11/11/1 12/12/1
f 3/3/1 6/6/1 13/13/1 11/11/1
f 6/6/1 8/8/1 14/14/1 13/13/1
f 8/8/1 10/10/1 15/15/1 14/14/1
f 12/12/1 11/11/1 16/16/1 17/17/1
f 11/11/1 13/13/1 18/18/1 16/16/1
f 13/13/1 14/14/1 19/19/1 18/18/1
f 14/14/1 15/15/1 20/20/1 19/19/1
f 17/17/1 16/16/1 21/21/1 22/22/1
f 16/16/1 18/18/1 23/23/1 21/21/1
f 18/18/1 19/19/1 24/24/1 23/23/1
f 19/19/1 20/20/1 25/25/1 24/24/1
# 16 polygons
......@@ -6,7 +6,7 @@ import { connect3D } from 'amos-3d/lib/designer';
import { RiskPoint, PatrolPoint, PersonPoint3D, MonitorPoint, ProbePoint,
FireResourcePoint, EquipmentPoint, FireCar3D, FirePoint, PointStatistics, ImpEquipmentMode } from './points';
import { eventTopics, isPointEvent , isLevelFilter } from './consts';
import { parseMarkers, parseLevelFilter } from './dataProcessor';
import { parseMarkers, parseLevelFilter, changeMarkerPosition } from './dataProcessor';
const loginUserName = Store.lsTool.read('userName');
const filterUser = ['tianbo', 'opera1', 'opera2'];
......@@ -50,6 +50,10 @@ class PointsPool extends Component {
// }
// }
// });
this.props.subscribe(eventTopics.point_position_change, (topic, data) => {
changeMarkerPosition(this, topic, data);
});
}
onMarkersCreated = (type, { markersCache }) => {
......
......@@ -47,7 +47,7 @@ export const eventTopics = {
point_change: 'base3d.view.point_change', // marker 点变化
batch_point_change: 'base3d.view.batch_point_change', // 批量 marker 点变化
linkdata_change: 'base3d.view.linkdata_change', // marker 点变化
point_position_change: 'base3d.view.point_change', // marker 点变化
point_position_change: 'base3d.view.position_change', // markerPostion 点变化
point_patrol: 'base3d.view.point_patrol', // 巡检点
point_risk: 'base3d.view.point_risk', // 风险点
......
......@@ -397,3 +397,18 @@ export const flyToSubView = (instance,obj,LENS_LEVEL) =>{
}
};
//改变marker坐标
export const changeMarkerPosition = (instance,obj,data) => {
const { id, type, position } = data;
(instance.markerList[convertType(type)] || []).forEach( mc => {
const extData = mc.getExtData();
if (extData.id === id && extData.type === type) {
mc.baseObjHelper.position = position;
}
});
};
const convertType = (type) => {
const fireEquipmentStr = 'fireCar,fireEquipment,fireChamber,fireFoamRoom,hydrant,pool';
return fireEquipmentStr.indexOf(type) > -1 ? 'fireEquipment' : type ;
};
......@@ -80,11 +80,11 @@ class RightEditPointPanel extends Component {
onChangePosition = ( inputType , value ) => {
let { positionX, positionY, positionZ } = this.state;
if (inputType === 'positionX'){
positionX = value;
positionX = Number(value);
} else if (inputType === 'positionY'){
positionY = value;
positionY = Number(value);
} else {
positionZ = value;
positionZ = Number(value);
}
const position = [positionX,positionY,positionZ];
this.mreageMarkerPosition(position);
......@@ -92,7 +92,7 @@ class RightEditPointPanel extends Component {
mreageMarkerPosition = ( position ) => {
const { detailData } = this.state;
PubSub.publish(eventTopics.point_position_change, { id: detailData.id, position });
PubSub.publish(eventTopics.point_position_change, { id: detailData.id, type: detailData.type , position });
this.props.changeMarkersData(position,detailData.type,detailData.id);
}
......
......@@ -8,7 +8,7 @@ import PointDialog from './PointDialog';
import { tirggerPlanTopic } from './../dataProcessor';
import { marker3DIoncMapper, markerTitleBgMapper } from './../../consts/imgStatic';
import { eventTopics, isPointEvent , isLevelFilter } from './../consts';
import { parseMarkers, parseLevelFilter } from '../dataProcessor';
import { parseMarkers, parseLevelFilter, changeMarkerPosition } from '../dataProcessor';
const getIcon = (markerType, level) => {
// return marker3DIoncMapper[`${markerType}_${level}`];
......@@ -18,14 +18,6 @@ const getIcon = (markerType, level) => {
return marker3DIoncMapper[`${markerType}`];
};
// const createMarkerLabel = text => {
// const div = document.createElement('div');
// div.style.position = 'absolute';
// div.style.marginTop = '-3rem';
// div.className = 'three-ui-anchor';
// div.innerText = text;
// return div;
// };
const urlMapper = {
fireCar: { file: 'fire-car', label: '消防车' },
fireEquipment: { file: 'fireEquip', label: '消防设备' },
......@@ -104,6 +96,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
}
this.setState({ planStarted: nextProps.planStarted });
};
componentWillUnmount() {
this.objAnchorHelper && this.objAnchorHelper.destroy();
}
......@@ -166,8 +159,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
obj.baseObjHelper.titleConfig = {
// 顶牌平面参数
planeOptions: {
width: 40,
height: 20,
width: 20,
height: 10,
position: [0, 20, 0],
doubleSide: true
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment