import React from 'react'; import connect from 'ui/connect'; import {Section} from 'ui/components/Section'; import Fa from 'ui/components/Fa'; import {constant} from 'lstream'; import ls from './ObjectExplorer.less'; import cx from 'classnames'; import {MShell} from '../../model/mshell'; import {MDatum} from '../../model/mdatum'; import mapContext from 'ui/mapContext'; import decoratorChain from 'ui/decoratorChain'; export default connect(streams => streams.craft.models.map(models => ({models}))) (function ObjectExplorer({models}) { return models.map(m => (m instanceof MShell) ?
{ m.faces.map(f => ) }
{m.edges.map(e => )}
: (m instanceof MDatum) ? : null); }); function EdgeSection({edge}) { return {edge.adjacentFaces.map(f => )} } function FaceSection({face}) { return {(face.productionInfo && face.productionInfo.role) &&
role: {face.productionInfo.role}} />} {(face.productionInfo && face.productionInfo.originatedFromPrimitive) &&
origin: {face.productionInfo.originatedFromPrimitive}} />}
{''}}> {face.sketchObjects.map(o =>
{o.id + ':' + o.sketchPrimitive.constructor.name}
)}
{face.edges &&
{face.edges.map(e => )}
} ; } const ModelSection = decoratorChain( mapContext((ctx, props) => ({ select: () => ctx.services.pickControl.pick(props.model) })), connect((streams, props) => (streams.selection[props.type] || constant([])).map(selection => ({selection})))) ( function ModelSection({model, type, selection, select, ...props}) { let labelClasses = cx(ls.modelLabel, { [ls.selected]: selection.indexOf(model.id) !== -1 }); let label = {type} {model.id} ; return
; } ); function CommonControls() { return ; }