// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <AIS_Plane.ixx>
-#include <TColgp_Array1OfPnt.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <AIS_Plane.hxx>
+#include <Aspect_TypeOfLine.hxx>
+#include <DsgPrs_ShadedPlanePresentation.hxx>
+#include <DsgPrs_XYZPlanePresentation.hxx>
#include <ElSLib.hxx>
-
+#include <Geom_Axis2Placement.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_Transformation.hxx>
+#include <GeomAdaptor_Surface.hxx>
+#include <gp_Pnt.hxx>
#include <Graphic3d_ArrayOfQuadrangles.hxx>
+#include <Graphic3d_AspectFillArea3d.hxx>
+#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Group.hxx>
+#include <Graphic3d_MaterialAspect.hxx>
+#include <Graphic3d_Structure.hxx>
+#include <Poly_Triangulation.hxx>
+#include <Precision.hxx>
+#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PlaneAspect.hxx>
-#include <Prs3d_DatumAspect.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Projector.hxx>
#include <Prs3d_ShadingAspect.hxx>
-#include <StdPrs_Plane.hxx>
-#include <StdPrs_ShadedSurface.hxx>
-
-#include <Geom_Plane.hxx>
-#include <GeomAdaptor_Surface.hxx>
-
-#include <Aspect_TypeOfLine.hxx>
-#include <Graphic3d_AspectLine3d.hxx>
-#include <Graphic3d_Structure.hxx>
-#include <Graphic3d_MaterialAspect.hxx>
-#include <Graphic3d_AspectFillArea3d.hxx>
-
-#include <DsgPrs_XYZPlanePresentation.hxx>
-#include <DsgPrs_ShadedPlanePresentation.hxx>
-#include <UnitsAPI.hxx>
-
+#include <Quantity_Color.hxx>
#include <Select3D_SensitiveTriangulation.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
+#include <Standard_Type.hxx>
+#include <StdPrs_Plane.hxx>
#include <StdPrs_ShadedShape.hxx>
-
-#include <Poly_Triangulation.hxx>
-
-#include <AIS_Drawer.hxx>
-
+#include <StdPrs_ShadedSurface.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
#include <TCollection_AsciiString.hxx>
+#include <UnitsAPI.hxx>
//=======================================================================
//function : AIS_Plane
{
ComputeFrame();
const Handle(Geom_Plane)& pl = myComponent;
- const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
+ Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
GeomAdaptor_Surface surf(thegoodpl);
StdPrs_Plane::Add(aPresentation,surf,myDrawer);
}
DA = myDrawer->DatumAspect();
Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
- if(myDrawer->Link()->PlaneAspect() == PA){
+ if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
yenavaitPA = Standard_False;
PA = new Prs3d_PlaneAspect();}
- if(myDrawer->Link()->DatumAspect() == DA){
+ if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
yenavaitDA = Standard_False;
DA = new Prs3d_DatumAspect();
}
{
if(!myHasOwnSize) return;
- if(!hasOwnColor){
- myDrawer->PlaneAspect().Nullify();
- myDrawer->DatumAspect().Nullify();
+ if(!hasOwnColor)
+ {
+ myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
+ myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
}
else{
- const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
- const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
+ const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
+ new Prs3d_PlaneAspect();
+ const Handle(Prs3d_DatumAspect) DA = myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() :
+ new Prs3d_DatumAspect();
myDrawer->PlaneAspect()->SetPlaneLength(PA->PlaneXLength(),PA->PlaneYLength());
myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
DA = myDrawer->DatumAspect();
Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
- if(myDrawer->Link()->PlaneAspect() == PA){
+ if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
yenavaitPA = Standard_False;
PA = new Prs3d_PlaneAspect();}
- if(myDrawer->Link()->DatumAspect() == DA){
+ if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
yenavaitDA = Standard_False;
DA = new Prs3d_DatumAspect();
}
void AIS_Plane::UnsetColor()
{
if(!hasOwnColor) return;
- if(!myHasOwnSize){
- myDrawer->PlaneAspect().Nullify();
- myDrawer->DatumAspect().Nullify();
+ if(!myHasOwnSize)
+ {
+ myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
+ myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
}
else{
- const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
+ const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
+ new Prs3d_PlaneAspect();
// const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
Quantity_Color C;Aspect_TypeOfLine T;Standard_Real W;
PA->EdgesAspect()->Aspect()->Values(C,T,W);
pl->D0 (U, V, myCenter);
}
else {
- const Handle(Geom_Plane)& thegoodpl =
- Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
+ Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
ElSLib::Parameters(thegoodpl->Pln(),myPmin,U,V);
U = 2.4*Abs(U);