myIsClickable = isClickable( aPlane );
// process mouse click on the object
- if ( myIsClickable );
+ if ( myIsClickable )
{
myViewer->getAISContext()->SetSelected( aPlane );
emit planeClicked( aPlane );
}
}
-
+/*!
+ Creates clipping plane based on the incoming plane
+*/
+Handle(Graphic3d_ClipPlane) OCCViewer_Viewer::createClipPlane(const gp_Pln& thePlane, const Standard_Boolean theIsOn)
+{
+ Handle(Graphic3d_ClipPlane) aGraphic3dPlane = new Graphic3d_ClipPlane( thePlane );
+ aGraphic3dPlane->SetOn( theIsOn );
+ aGraphic3dPlane->SetCapping( Standard_True );
+ return aGraphic3dPlane;
+}
/*!
Applies clipping planes to clippable objects
*/
gp_Pnt anOrigin( aPlane.X, aPlane.Y, aPlane.Z );
gp_Dir aDirection( aDx, aDy, aDz );
- Handle(Graphic3d_ClipPlane) aGraphic3dPlane = new Graphic3d_ClipPlane( gp_Pln( anOrigin, aDirection ) );
- aGraphic3dPlane->SetOn( aPlane.IsOn );
-
- myInternalClipPlanes.Append( aGraphic3dPlane );
+ myInternalClipPlanes.Append( createClipPlane( gp_Pln( anOrigin, aDirection ), aPlane.IsOn ) );
myClipPlanes.push_back( aPlane );
}
void setStaticTrihedronDisplayed(const bool on);
/* Clip planes management */
+ Handle(Graphic3d_ClipPlane) createClipPlane(const gp_Pln& thePlane, const Standard_Boolean theIsOn);
void setClipPlanes (ClipPlanesList theList);
ClipPlanesList getClipPlanes() const;
void applyExistingClipPlanesToObject (const Handle(AIS_InteractiveObject)& theObject);
pln.Coefficients(a, b, c, d);
Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
- Handle(Graphic3d_ClipPlane) aClipPlane;
if(aPlanes.Size() > 0 ) {
Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
- aClipPlane = anIter.Value();
+ Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
aClipPlane->SetEquation(pln);
aClipPlane->SetOn(Standard_True);
} else {
- aClipPlane = new Graphic3d_ClipPlane(pln);
- view->AddClipPlane(aClipPlane);
- aClipPlane->SetOn(Standard_True);
+ view->AddClipPlane( myModel->createClipPlane( pln, Standard_True ) );
}
}
else {