MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / create

Method create

source/MRViewer/MRObjectTransformWidget.cpp:91–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89{
90
91void ObjectTransformWidget::create( const Box3f& box, const AffineXf3f& worldXf, std::shared_ptr<ITransformControls> controls )
92{
93 if ( controlsRoot_ )
94 reset();
95
96 boxDiagonal_ = box.size();
97 controls_ = controls;
98 if ( !controls_ )
99 {
100 auto thisControls = std::make_shared<TransformControls>();
101 TransformControls::VisualParams params;
102 params.update( box );
103 thisControls->setVisualParams( params );
104 controls_ = thisControls;
105 }
106 // make x - arrow
107 controlsRoot_ = std::make_shared<Object>();
108 controlsRoot_->setName( "TransformWidgetRoot" );
109 controlsRoot_->setAncillary( true );
110
111 controls_->setCenter( box.center() );
112 controls_->init( controlsRoot_ );
113
114 SceneRoot::get().addChild( controlsRoot_ );
115 setControlsXf_( worldXf, true );
116
117 setTransformMode( ControlBit::FullMask );
118
119 // 10 group to imitate plugins behavior
120 connect( &getViewerInstance(), 10, boost::signals2::at_front );
121 xfValidatorConnection_ = controlsRoot_->worldXfChangedSignal.connect( [&] ()
122 {
123 if ( !approvedChange_ && picked_ )
124 stopModify_();
125 } );
126}
127
128void ObjectTransformWidget::reset()
129{

Callers

nothing calls this directly

Calls 10

setVisualParamsMethod · 0.80
setAncillaryMethod · 0.80
addChildMethod · 0.80
getFunction · 0.50
sizeMethod · 0.45
updateMethod · 0.45
setCenterMethod · 0.45
centerMethod · 0.45
initMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected