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 {
this.r3d.on('keydown', evt => {
// 返回上级
if (this.lensLevel === LENS_LEVEL.SUB && evt.code === 'Backspace') {
this.lensJumpFactory.jumpRoot(obj => {
this.lensJumpFactory.fadeIn(obj);
});
this.initModelDisplay();
this.outlineFactory.toggleOutline([]);//清除选中
this.lensLevel = LENS_LEVEL.ROOT;
}
......@@ -1572,6 +1570,7 @@ class View3D extends Component {
});
} else if (type === 'out_except_model'){
this.stagePilot.positionCtl.clearDrag();
this.initModelDisplay();
if (isAreaSave){
this.setState({ promptData:
{
......@@ -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)=>{
this.setState({ headerName: name });
}
......@@ -1775,7 +1786,7 @@ class View3D extends Component {
<FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} />
{isEditMode && this.renderAreas()}
{this.renderPolygonRegion(exceptionAreas)}
{startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} focusPosition={this.focusPosition} />}
{startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} focusObject={this.focusObject} />}
</A3DDesigner>
</div>
{ isEditMode &&
......
......@@ -377,19 +377,20 @@ export const cacheObjsSave = (instance,obj,LENS_LEVEL)=>{
* @param {object} obj
*/
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 => {
// 隐藏所有一级
instance._cacheObj[key].visible = false;
// 隐藏非目标二级
if (key !== obj.userData.key){
if (key !== objKey){
instance.processorLevel[key].forEach(sec => {
instance._cacheObj[sec].visible = false;
});
}
});
// 镜头切换
obj.userData.fitView && instance.cameraFactory.fitView(obj.userData.fitView);//视角调整为最近视角
fitView && instance.cameraFactory.fitView(fitView);//视角调整为最近视角
instance.lensLevel = LENS_LEVEL.SUB;
} else {
instance.focusObject(obj);
......
......@@ -44,10 +44,9 @@ class ExceptionArea extends Component {
}
onMarkerClick = (marker) => {
console.log(marker);
const { extData } = marker;
const { extData, node } = marker;
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 {
ExceptionArea.propTypes = {
markers: PropTypes.array,
handleExceptModel: PropTypes.func,
focusPosition: PropTypes.func
focusObject: PropTypes.func
};
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