// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <AIS_Plane.ixx>
+#include <AIS_Plane.hxx>
-#include <TColgp_Array1OfPnt.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
+#include <AIS_InteractiveContext.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 <StdPrs_ShadedSurface.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
#include <TCollection_AsciiString.hxx>
+#include <UnitsAPI.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(AIS_Plane,AIS_InteractiveObject)
//=======================================================================
//function : AIS_Plane
myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
{
InitDrawerAttributes();
- SetHilightMode(0);
}
//=======================================================================
{
InitDrawerAttributes();
ComputeFields();
- SetHilightMode(0);
-
}
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
{
- aPresentation->Clear();
-
ComputeFields();
aPresentation->SetInfiniteState(myInfiniteState);
myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(myCurrentMode == 0? 1 : 3);
new Prs3d_DatumAspect();
myDrawer->PlaneAspect()->SetPlaneLength(PA->PlaneXLength(),PA->PlaneYLength());
- myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
- DA->SecondAxisLength(),
- DA->ThirdAxisLength());
+ myDrawer->DatumAspect()->SetAxisLength(DA->AxisLength(Prs3d_DP_XAxis),
+ DA->AxisLength(Prs3d_DP_YAxis),
+ DA->AxisLength(Prs3d_DP_ZAxis));
}
myHasOwnSize = Standard_False;
return Abs(X-Y)<=Precision::Confusion();
}
-
//=======================================================================
//function : SetColor
//purpose :
//=======================================================================
-
-
-void AIS_Plane::SetColor(const Quantity_NameOfColor aCol)
-{
- SetColor(Quantity_Color(aCol));
-}
-
void AIS_Plane::SetColor(const Quantity_Color &aCol)
{
// if the plane already has its proper size, there is an already created planeaspect
}
PA->EdgesAspect()->SetColor(aCol);
- DA->FirstAxisAspect()->SetColor(aCol);
- DA->SecondAxisAspect()->SetColor(aCol);
- DA->ThirdAxisAspect()->SetColor(aCol);
+ DA->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
+ DA->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
+ DA->LineAspect(Prs3d_DP_ZAxis)->SetColor(aCol);
if(!yenavaitPA)
myDrawer->SetPlaneAspect(PA);
myDrawer->ShadingAspect()->SetColor(aCol);
hasOwnColor=Standard_True;
- myOwnColor = aCol;
+ myDrawer->SetColor (aCol);
}
//=======================================================================
//function : SetColor
else{
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);
- Quantity_NameOfColor Col = C.Name();
+ Quantity_Color Col = PA->EdgesAspect()->Aspect()->Color();
myDrawer->PlaneAspect()->EdgesAspect()->SetColor(Col);
- myDrawer->DatumAspect()->FirstAxisAspect()->SetColor(Col);
- myDrawer->DatumAspect()->SecondAxisAspect()->SetColor(Col);
- myDrawer->DatumAspect()->ThirdAxisAspect()->SetColor(Col);
+ myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(Col);
+ myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(Col);
+ myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetColor(Col);
}
oX.Coord(x1,y1,z1);
oY.Coord(x2,y2,z2);
oZ.Coord(x3,y3,z3);
- Standard_Real DS1 = DA->FirstAxisLength();
- Standard_Real DS2 = DA->SecondAxisLength();
- Standard_Real DS3 = DA->ThirdAxisLength();
+ Standard_Real DS1 = DA->AxisLength(Prs3d_DP_XAxis);
+ Standard_Real DS2 = DA->AxisLength(Prs3d_DP_YAxis);
+ Standard_Real DS3 = DA->AxisLength(Prs3d_DP_ZAxis);
// gp_Pnt aPt2,aPt3;
switch (myTypeOfPlane) {
void AIS_Plane::InitDrawerAttributes()
{
-
Handle(Prs3d_ShadingAspect) shasp = new Prs3d_ShadingAspect();
shasp->SetMaterial(Graphic3d_NOM_PLASTIC);
shasp->SetColor(Quantity_NOC_GRAY40);
myDrawer->SetShadingAspect(shasp);
Handle(Graphic3d_AspectFillArea3d) asf = shasp->Aspect();
Graphic3d_MaterialAspect asp = asf->FrontMaterial();
- asp.SetTransparency(0.8);
+ asp.SetTransparency (0.8f);
asf->SetFrontMaterial(asp);
asf->SetBackMaterial(asp);
-
-
}
//=======================================================================