Commit b2396581 authored by suhuiguang's avatar suhuiguang

1.修改缺陷

parent dbfb0677
export const chunk = (arr,size) => {
let objArr = [];
let index = 0;
let objArrlen = arr.length / size;
for (let i = 0;i < objArrlen;i++){
let arrTemp = [];
for (let j = 0;j < size;j++){
arrTemp[j] = arr[index++];
if (index === arr.length){
break;
}
}
objArr[i] = arrTemp;
}
return objArr;
};
...@@ -270,9 +270,7 @@ class View3D extends Component { ...@@ -270,9 +270,7 @@ class View3D extends Component {
this.r3d.on('keydown', evt => { this.r3d.on('keydown', evt => {
// 返回上级 // 返回上级
if (this.lensLevel === LENS_LEVEL.SUB && evt.code === 'Backspace') { if (this.lensLevel === LENS_LEVEL.SUB && evt.code === 'Backspace') {
this.lensJumpFactory.jumpRoot(obj => { this.initModelDisplay();
this.lensJumpFactory.fadeIn(obj);
});
this.outlineFactory.toggleOutline([]);//清除选中 this.outlineFactory.toggleOutline([]);//清除选中
this.lensLevel = LENS_LEVEL.ROOT; this.lensLevel = LENS_LEVEL.ROOT;
} }
...@@ -1572,6 +1570,7 @@ class View3D extends Component { ...@@ -1572,6 +1570,7 @@ class View3D extends Component {
}); });
} else if (type === 'out_except_model'){ } else if (type === 'out_except_model'){
this.stagePilot.positionCtl.clearDrag(); this.stagePilot.positionCtl.clearDrag();
this.initModelDisplay();
if (isAreaSave){ if (isAreaSave){
this.setState({ promptData: this.setState({ promptData:
{ {
...@@ -1601,6 +1600,18 @@ class View3D extends Component { ...@@ -1601,6 +1600,18 @@ class View3D extends Component {
} }
} }
/**
*
*初始化模型显示(显示所有3维模型),清除选中
* @memberof View3D
*/
initModelDisplay =()=>{
this.lensJumpFactory.jumpRoot(obj => {
this.lensJumpFactory.fadeIn(obj);
});
this.outlineFactory.toggleOutline([]);
}
setHeaderName =(name)=>{ setHeaderName =(name)=>{
this.setState({ headerName: name }); this.setState({ headerName: name });
} }
...@@ -1775,7 +1786,7 @@ class View3D extends Component { ...@@ -1775,7 +1786,7 @@ class View3D extends Component {
<FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} /> <FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} />
{isEditMode && this.renderAreas()} {isEditMode && this.renderAreas()}
{this.renderPolygonRegion(exceptionAreas)} {this.renderPolygonRegion(exceptionAreas)}
{startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} focusPosition={this.focusPosition} />} {startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} focusObject={this.focusObject} />}
</A3DDesigner> </A3DDesigner>
</div> </div>
{ isEditMode && { isEditMode &&
......
...@@ -377,19 +377,20 @@ export const cacheObjsSave = (instance,obj,LENS_LEVEL)=>{ ...@@ -377,19 +377,20 @@ export const cacheObjsSave = (instance,obj,LENS_LEVEL)=>{
* @param {object} obj * @param {object} obj
*/ */
export const flyToSubView = (instance,obj,LENS_LEVEL) =>{ export const flyToSubView = (instance,obj,LENS_LEVEL) =>{
if (obj.userData && obj.userData.level && obj.userData.level === 'root'){ const { level, key: objKey, fitView } = obj.userData || {};
if (level && objKey && level === 'root' && (instance.processorLevel[objKey] || []).length > 0){
Object.keys(instance.processorLevel).forEach(key => { Object.keys(instance.processorLevel).forEach(key => {
// 隐藏所有一级 // 隐藏所有一级
instance._cacheObj[key].visible = false; instance._cacheObj[key].visible = false;
// 隐藏非目标二级 // 隐藏非目标二级
if (key !== obj.userData.key){ if (key !== objKey){
instance.processorLevel[key].forEach(sec => { instance.processorLevel[key].forEach(sec => {
instance._cacheObj[sec].visible = false; instance._cacheObj[sec].visible = false;
}); });
} }
}); });
// 镜头切换 // 镜头切换
obj.userData.fitView && instance.cameraFactory.fitView(obj.userData.fitView);//视角调整为最近视角 fitView && instance.cameraFactory.fitView(fitView);//视角调整为最近视角
instance.lensLevel = LENS_LEVEL.SUB; instance.lensLevel = LENS_LEVEL.SUB;
} else { } else {
instance.focusObject(obj); instance.focusObject(obj);
......
...@@ -44,10 +44,9 @@ class ExceptionArea extends Component { ...@@ -44,10 +44,9 @@ class ExceptionArea extends Component {
} }
onMarkerClick = (marker) => { onMarkerClick = (marker) => {
console.log(marker); const { extData, node } = marker;
const { extData } = marker;
this.props.handleExceptModel && this.props.handleExceptModel('into_except_model',extData.id); this.props.handleExceptModel && this.props.handleExceptModel('into_except_model',extData.id);
this.props.focusPosition(this.toCameraPosition(extData.position)); this.props.focusObject && this.props.focusObject(node);
} }
...@@ -111,7 +110,7 @@ class ExceptionArea extends Component { ...@@ -111,7 +110,7 @@ class ExceptionArea extends Component {
ExceptionArea.propTypes = { ExceptionArea.propTypes = {
markers: PropTypes.array, markers: PropTypes.array,
handleExceptModel: PropTypes.func, handleExceptModel: PropTypes.func,
focusPosition: PropTypes.func focusObject: PropTypes.func
}; };
export default ExceptionArea; export default ExceptionArea;
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