Commit 95fd4c45 authored by 单奇雲's avatar 单奇雲

冲突

parents 6c1be8a6 02e22f30
...@@ -483,7 +483,7 @@ class View3D extends Component { ...@@ -483,7 +483,7 @@ class View3D extends Component {
onAllDone = objGroup => { onAllDone = objGroup => {
this.sceneFactory.level.change(objGroup); this.sceneFactory.level.change(objGroup);
this.cameraFactory.fitView(desigerHelperConfig.cameraEffect); this.stagePilot.rendererFactory.setupUModelSahdow();//接受阴影
this.setState({ this.setState({
startAsyncLoad: true startAsyncLoad: true
}); });
...@@ -493,6 +493,8 @@ class View3D extends Component { ...@@ -493,6 +493,8 @@ class View3D extends Component {
onAfterWorkerInit = workerObjGroup => { onAfterWorkerInit = workerObjGroup => {
// 处理跳跃 // 处理跳跃
this.lensJumpFactory.process(workerObjGroup); this.lensJumpFactory.process(workerObjGroup);
// 子线程模型加上阴影
workerObjGroup.toggleShadow(true);
}; };
onComplete = obj => { onComplete = obj => {
...@@ -893,20 +895,14 @@ class View3D extends Component { ...@@ -893,20 +895,14 @@ class View3D extends Component {
savePointData = () => { savePointData = () => {
let { markers, pointType, isPointSave} = this.state; let { markers, pointType, isPointSave} = this.state;
this.setState({isPointSave: true}); this.setState({isPointSave: true});
console.log(markers);
let paramsArr = []; let paramsArr = [];
for ( let key in markers ){ paramsArr = markers[pointType].filter(e=> e.isEdit).map(item=>{
let item = markers[key]; return {
for (let i = 0; i < item.length; i++) { pointId: item.id,
if(item[i].isChange){ pointType: item.type,
paramsArr.push({ position3d: item.position.length > 1 ? `${item.position[0]},${item.position[1]},${item.position[2]}` : null
pointId: item[i].id, };
pointType: item[i].type, });
position3d: `${item[i].position[0]},${item[i].position[1]},${item[i].position[2]}`
});
}
}
}
savePointListAction(paramsArr).then( savePointListAction(paramsArr).then(
data => { data => {
getPointTreeAction(pointType).then( getPointTreeAction(pointType).then(
...@@ -1143,8 +1139,8 @@ class View3D extends Component { ...@@ -1143,8 +1139,8 @@ class View3D extends Component {
title: dragItem.name, title: dragItem.name,
label: dragItem.name, label: dragItem.name,
level: dragItem.level, level: dragItem.level,
levelStr: dragItem.levelStr, isEdit: true,
isChange: true levelStr: dragItem.levelStr
}; };
let selectPoints = { let selectPoints = {
...@@ -1538,35 +1534,30 @@ class View3D extends Component { ...@@ -1538,35 +1534,30 @@ class View3D extends Component {
// 非法元素 // 非法元素
return object; return object;
} }
addMarker=({extData,position})=>{
let {markers} =this.state;
for (let i = 0; i < markers[extData.type].length; i++) {
const marker = markers[extData.type][i];
if(marker.id === extData.id){
marker.position = position;
marker.isChange = true;
break;
}
};
// let paramsArr = [{
// pointId: extData.id,
// pointType: extData.type,
// position3d: `${position[0]},${position[1]},${position[2]}`
// }];
// console.log(paramsArr)
let selectPoints = {
id: extData.id,
type: extData.type,
position3d: position
}
this.setState({selectPoints,markers,showRightPanel:true });
// savePointListAction(paramsArr).then(data => { addMarker=({ extData, position })=>{
// }) const me = this;
// this.setState({positionxyz: position}) const { markers } = me;
const isInside = me.polygonRegion && extData.parentId && me.polygonRegion[extData.parentId].pointInPolygon([position.x,position.y,position.z]);
if (isInside){
markers[extData.type].forEach(e => {
if (e.id === extData.id){
e.position = `${position[0]},${position[1]},${position[2]}`;
e.isEdit = true;
}
});
extData.position = position;
this.setState({
markers,
positionxyz: position,
showRightPanel: true,
selectPoints: extData
});
} else {
message.error('不能放置非所在区域');
}
} }
render() { render() {
const { const {
objs, objs,
......
...@@ -80,7 +80,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){ ...@@ -80,7 +80,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
componentWillReceiveProps = nextProps => { componentWillReceiveProps = nextProps => {
if(nextProps.isEditMode){ if(nextProps.isEditMode){
this.markersCache.eachValue(obj=>{ this.markersCache.eachValue(obj=>{
// this.setTopCardConf(obj, obj.extData); this.setTopCardConf(obj, obj.extData);
if(nextProps.selectPoints.type == obj.extData.type && nextProps.selectPoints.id ==obj.extData.id ){ if(nextProps.selectPoints.type == obj.extData.type && nextProps.selectPoints.id ==obj.extData.id ){
this.setTwinkleConf(obj); this.setTwinkleConf(obj);
} }
......
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