mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0025773: Visualization - remove AIS_Drawer class and transfer its Link() logic to Prs3d_Drawer
This commit is contained in:
parent
44b47a9a7e
commit
6262338c4b
@ -7,7 +7,7 @@
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <HLRBRep_PolyAlgo.hxx>
|
||||
#include <HLRBRep_PolyHLRToShape.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepMesh.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <BRepOffsetAPI_MakeOffset.hxx>
|
||||
#include <BRepBuilderAPI_MakePolygon.hxx>
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <V3d_PositionalLight.hxx>
|
||||
#include <V3d_DirectionalLight.hxx>
|
||||
#include <V3d_SpotLight.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_Texture2D.hxx>
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
@ -231,7 +231,7 @@ void Transform_Presentation::sample1()
|
||||
gp_Ax2 ax2(ax1Pnt.Translated(gp_Vec(0,0,70)),ax1Dir);
|
||||
Handle(Geom_Curve) aCirc = new Geom_TrimmedCurve(new Geom_Circle(ax2,20),0,angle);
|
||||
Handle(AIS_InteractiveObject) aICirc = drawCurve(aCirc,Quantity_NOC_WHITE,Standard_False);
|
||||
Handle(AIS_Drawer) aDrawer = new AIS_Drawer;
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer;
|
||||
aDrawer->Link()->SetLineArrowDraw(Standard_True);
|
||||
aDrawer->Link()->ArrowAspect()->SetLength(2);
|
||||
getAISContext()->SetLocalAttributes (aICirc, aDrawer);
|
||||
|
@ -955,7 +955,7 @@ if(NbResults>0){ \n\
|
||||
DisplayPoint(aDoc,N,aString.ToCString(),false,0.5,0,-0.6);
|
||||
|
||||
Handle(ISession_Surface) aSurface = new ISession_Surface(SP);
|
||||
Handle (AIS_Drawer) CurDrawer = aSurface->Attributes();
|
||||
Handle(Prs3d_Drawer) CurDrawer = aSurface->Attributes();
|
||||
CurDrawer->UIsoAspect()->SetNumber(10);
|
||||
CurDrawer->VIsoAspect()->SetNumber(10);
|
||||
aDoc->GetAISContext()->SetLocalAttributes(aSurface, CurDrawer);
|
||||
|
@ -35,7 +35,7 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres
|
||||
const Standard_Integer aMode)
|
||||
{
|
||||
GeomAdaptor_Curve anAdaptorCurve(myCurve);
|
||||
Handle(AIS_Drawer) aDrawer = new AIS_Drawer();
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
|
||||
aDrawer->LineAspect()->SetColor(Quantity_NOC_RED);
|
||||
|
||||
switch (aMode)
|
||||
|
@ -39,7 +39,7 @@ void ISession_Surface::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPr
|
||||
GeomAdaptor_Surface anAdaptorSurface(mySurface);
|
||||
Handle(GeomAdaptor_HSurface) anAdaptorHSurface = new GeomAdaptor_HSurface(mySurface);
|
||||
|
||||
Handle(AIS_Drawer) aDrawer = new AIS_Drawer();
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
|
||||
aDrawer->LineAspect()->SetColor(Quantity_NOC_YELLOW3);
|
||||
|
||||
switch (aMode)
|
||||
|
@ -84,7 +84,6 @@
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Aspect_Grid.hxx>
|
||||
#include <Aspect_Window.hxx>
|
||||
#include <Aspect_Background.hxx>
|
||||
@ -216,6 +215,7 @@
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
|
@ -15,7 +15,7 @@ IMPLEMENT_STANDARD_RTTIEXT(ISession_Direction,AIS_InteractiveObject)
|
||||
|
||||
#include "DsgPrs_LengthPresentation.hxx"
|
||||
#include "Prs3d_ArrowAspect.hxx"
|
||||
#include "AIS_Drawer.hxx"
|
||||
#include "Prs3d_Drawer.hxx"
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@ -72,7 +72,6 @@
|
||||
# pragma comment (lib,"TKernel.lib")
|
||||
*/
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_Circle.hxx>
|
||||
#include <AIS_Line.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
@ -121,6 +120,7 @@
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_PlaneAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
|
@ -197,7 +197,7 @@ void CViewer2dDoc::OnBUTTONTestLine()
|
||||
TopoDS_Face F = BRepBuilderAPI_MakeFace(W);
|
||||
Handle_AIS_Shape aRect = new AIS_Shape(F);
|
||||
//set attributes of boundaries
|
||||
Handle(AIS_Drawer) aDrawer = new AIS_Drawer();
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
|
||||
Handle(Prs3d_LineAspect) aLineAttrib =
|
||||
new Prs3d_LineAspect(Quantity_NOC_YELLOW,
|
||||
(Aspect_TypeOfLine)(Aspect_TOL_SOLID+j),1);
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#pragma warning( default : 4244 ) // Issue warning 4244
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_ListOfInteractive.hxx>
|
||||
@ -90,6 +89,7 @@
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#pragma warning( default : 4244 ) // Issue warning 4244
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
@ -86,6 +85,7 @@
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
@ -106,7 +106,6 @@
|
||||
# pragma comment (lib,"TKXS214.lib")
|
||||
*/
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
@ -144,6 +143,7 @@
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
|
@ -117,7 +117,6 @@ enum CurrentAction3d {
|
||||
*/
|
||||
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
@ -155,6 +154,7 @@ enum CurrentAction3d {
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE(ISession_Curve,AIS_InteractiveObject)
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <Precision.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
@ -89,7 +89,7 @@ void CAISNbrIsosDialog::OnDeltaposSpinaisisosv(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
|
||||
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
void CAISNbrIsosDialog::UpdateIsos ()
|
||||
{
|
||||
@ -99,8 +99,8 @@ void CAISNbrIsosDialog::UpdateIsos ()
|
||||
myCurrentIC->MoreCurrent ();
|
||||
myCurrentIC->NextSelected ())
|
||||
{
|
||||
Handle (AIS_InteractiveObject) CurObject;
|
||||
Handle (AIS_Drawer) CurDrawer;
|
||||
Handle(AIS_InteractiveObject) CurObject;
|
||||
Handle(Prs3d_Drawer) CurDrawer;
|
||||
|
||||
|
||||
CurObject = myCurrentIC->Current();
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Line.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_TexturedShape.hxx>
|
||||
#include <Aspect_Grid.hxx>
|
||||
|
@ -328,8 +328,6 @@ is
|
||||
imported ColoredShape;
|
||||
imported TexturedShape;
|
||||
|
||||
class Drawer;
|
||||
|
||||
class InteractiveContext;
|
||||
|
||||
class GraphicTool;
|
||||
@ -681,7 +679,7 @@ is
|
||||
|
||||
|
||||
ComputeProjEdgePresentation(aPres : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
anEdge : Edge from TopoDS;
|
||||
ProjCurve: Curve from Geom;
|
||||
FirstP : Pnt from gp;
|
||||
@ -692,7 +690,7 @@ is
|
||||
aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT);
|
||||
|
||||
ComputeProjVertexPresentation(aPres : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
aVertex : Vertex from TopoDS;
|
||||
ProjPoint: Pnt from gp;
|
||||
aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
|
||||
|
@ -1390,18 +1390,18 @@ gp_Pnt AIS::NearestApex(const gp_Elips & elips,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const TopoDS_Edge& anEdge,
|
||||
const Handle( Geom_Curve )& ProjCurve,
|
||||
const gp_Pnt& FirstP,
|
||||
const gp_Pnt& LastP,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfLine aProjTOL,
|
||||
const Aspect_TypeOfLine aCallTOL )
|
||||
void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Handle(Prs3d_Drawer)& aDrawer,
|
||||
const TopoDS_Edge& anEdge,
|
||||
const Handle(Geom_Curve)& ProjCurve,
|
||||
const gp_Pnt& FirstP,
|
||||
const gp_Pnt& LastP,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfLine aProjTOL,
|
||||
const Aspect_TypeOfLine aCallTOL)
|
||||
{
|
||||
if (!aDrawer->HasWireAspect()){
|
||||
if (!aDrawer->HasOwnWireAspect()){
|
||||
aDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aProjTOL,2.));}
|
||||
else {
|
||||
// CLE
|
||||
@ -1493,16 +1493,16 @@ void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPres
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS::ComputeProjVertexPresentation( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const TopoDS_Vertex& aVertex,
|
||||
const gp_Pnt& ProjPoint,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfMarker aProjTOM,
|
||||
const Aspect_TypeOfLine aCallTOL )
|
||||
void AIS::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const TopoDS_Vertex& aVertex,
|
||||
const gp_Pnt& ProjPoint,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfMarker aProjTOM,
|
||||
const Aspect_TypeOfLine aCallTOL)
|
||||
{
|
||||
if (!aDrawer->HasPointAspect()){
|
||||
if (!aDrawer->HasOwnPointAspect()){
|
||||
aDrawer->SetPointAspect(new Prs3d_PointAspect(aProjTOM, aColor,1));}
|
||||
else {
|
||||
// CLE
|
||||
@ -1516,7 +1516,7 @@ void AIS::ComputeProjVertexPresentation( const Handle( Prs3d_Presentation )& aPr
|
||||
// calculate the projection
|
||||
StdPrs_Point::Add(aPresentation, new Geom_CartesianPoint(ProjPoint), aDrawer);
|
||||
|
||||
if (!aDrawer->HasWireAspect()){
|
||||
if (!aDrawer->HasOwnWireAspect()){
|
||||
aDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aCallTOL,2.));}
|
||||
else {
|
||||
// CLE
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <AIS_AngleDimension.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <DsgPrs_XYZAxisPresentation.hxx>
|
||||
#include <UnitsAPI.hxx>
|
||||
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <ProjLib.hxx>
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <ProjLib.hxx>
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <TopoDS.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <GC_MakeArcOfCircle.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
@ -128,10 +127,12 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
|
||||
hasOwnColor=Standard_True;
|
||||
myOwnColor=aCol;
|
||||
|
||||
Standard_Real WW = HasWidth()? myOwnWidth:
|
||||
AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
Standard_Real WW = HasWidth() ? myOwnWidth :
|
||||
myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
|
||||
1.;
|
||||
|
||||
if (!myDrawer->HasLineAspect ())
|
||||
if (!myDrawer->HasOwnLineAspect ())
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
else
|
||||
myDrawer->LineAspect()->SetColor(aCol);
|
||||
@ -147,10 +148,10 @@ void AIS_Circle::SetWidth(const Standard_Real aValue)
|
||||
{
|
||||
myOwnWidth=aValue;
|
||||
|
||||
if (!myDrawer->HasLineAspect ()) {
|
||||
Quantity_Color CC;
|
||||
if (!myDrawer->HasOwnLineAspect ()) {
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
||||
} else
|
||||
myDrawer->LineAspect()->SetWidth(aValue);
|
||||
@ -169,9 +170,9 @@ void AIS_Circle::UnsetColor()
|
||||
|
||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Quantity_Color CC;
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
myDrawer->LineAspect()->SetColor(CC);
|
||||
myOwnColor = CC;
|
||||
}
|
||||
@ -187,7 +188,7 @@ void AIS_Circle::UnsetWidth()
|
||||
|
||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Standard_Real WW = AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
|
||||
myDrawer->LineAspect()->SetWidth(WW);
|
||||
myOwnWidth = WW;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
@ -41,8 +42,8 @@
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE (AIS_ColoredDrawer, AIS_Drawer)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredDrawer, AIS_Drawer)
|
||||
IMPLEMENT_STANDARD_HANDLE (AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE (AIS_ColoredShape, AIS_Shape)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredShape, AIS_Shape)
|
||||
@ -203,15 +204,15 @@ void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aDrawer->HasShadingAspect())
|
||||
if (aDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetColor (theColor, myCurrentFacingModel);
|
||||
}
|
||||
if (aDrawer->HasLineAspect())
|
||||
if (aDrawer->HasOwnLineAspect())
|
||||
{
|
||||
aDrawer->LineAspect()->SetColor (theColor);
|
||||
}
|
||||
if (aDrawer->HasWireAspect())
|
||||
if (aDrawer->HasOwnWireAspect())
|
||||
{
|
||||
aDrawer->WireAspect()->SetColor (theColor);
|
||||
}
|
||||
@ -237,11 +238,11 @@ void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aDrawer->HasLineAspect())
|
||||
if (aDrawer->HasOwnLineAspect())
|
||||
{
|
||||
aDrawer->LineAspect()->SetWidth (theLineWidth);
|
||||
}
|
||||
if (aDrawer->HasWireAspect())
|
||||
if (aDrawer->HasOwnWireAspect())
|
||||
{
|
||||
aDrawer->WireAspect()->SetWidth (theLineWidth);
|
||||
}
|
||||
@ -261,8 +262,8 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
for (DataMapOfShapeColor::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_Drawer)& aDrawer = anIter.Value();
|
||||
if (aDrawer->HasShadingAspect())
|
||||
const Handle(Prs3d_Drawer)& aDrawer = anIter.Value();
|
||||
if (aDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetTransparency (theValue, myCurrentFacingModel);
|
||||
}
|
||||
@ -284,7 +285,7 @@ void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
{
|
||||
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
|
||||
//if (aDrawer->HasOwnMaterial()) continue;
|
||||
if (aDrawer->HasShadingAspect())
|
||||
if (aDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), Standard_False); // aDrawer->IsTransparent()
|
||||
}
|
||||
@ -377,7 +378,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
||||
{
|
||||
const TopoDS_Shape& aShapeKey = aMapIter.Key(); // key shape with detailed color or a base shape
|
||||
const TopoDS_Compound& aShapeDraw = aMapIter.Value(); // compound of subshapes with <aShType> type
|
||||
Handle(AIS_Drawer) aDrawer;
|
||||
Handle(Prs3d_Drawer) aDrawer;
|
||||
if (myShapeColors.Find (aShapeKey, aCustomDrawer))
|
||||
{
|
||||
aDrawer = aCustomDrawer;
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef _AIS_ColoredShape_HeaderFile
|
||||
#define _AIS_ColoredShape_HeaderFile
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
@ -26,11 +26,11 @@
|
||||
#include <StdPrs_Volume.hxx>
|
||||
|
||||
//! Customizable properties.
|
||||
class AIS_ColoredDrawer : public AIS_Drawer
|
||||
class AIS_ColoredDrawer : public Prs3d_Drawer
|
||||
{
|
||||
public:
|
||||
|
||||
AIS_ColoredDrawer (const Handle(AIS_Drawer)& theLink)
|
||||
AIS_ColoredDrawer (const Handle(Prs3d_Drawer)& theLink)
|
||||
: myIsHidden (Standard_False),
|
||||
myHasOwnColor (Standard_False),
|
||||
myHasOwnWidth (Standard_False)
|
||||
@ -58,7 +58,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_ColoredDrawer, AIS_Drawer)
|
||||
DEFINE_STANDARD_HANDLE(AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
|
||||
//! Presentation of the shape with customizable sub-shapes properties.
|
||||
class AIS_ColoredShape : public AIS_Shape
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
#include <StdPrs_WFDeflectionShape.hxx>
|
||||
|
@ -23,12 +23,12 @@
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <AIS_KindOfSurface.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_DimensionUnits.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
|
@ -1,682 +0,0 @@
|
||||
-- Created on: 1992-09-18
|
||||
-- Created by: Odile Olivier
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Drawer from AIS inherits Drawer from Prs3d
|
||||
|
||||
---Purpose:
|
||||
-- A framework to manage display attributes of interactive objects.
|
||||
-- An interactive object can have a certain number of
|
||||
-- display attributes specific to it. These include
|
||||
-- visualization mode, color, material
|
||||
-- and so on. To deal with this information, the
|
||||
-- interactive context has a Drawer attribute manager
|
||||
-- which is valid by default for the objects it
|
||||
-- controls. When an interactive object is visualized, the
|
||||
-- required graphic display attributes are first taken from
|
||||
-- its own Drawer if it has the ones required, or from the
|
||||
-- context drawer for those it does not have them.
|
||||
-- The set of display attributes of an interactive object is
|
||||
-- stocked in an AIS_Drawer, which is, in fact, a
|
||||
-- Prs3d_Drawer with the possibility of a link to another
|
||||
-- display attribute manager. This drawer then manages
|
||||
-- the stocked graphic display attributes by specifying
|
||||
-- how the presentation algorithms compute the
|
||||
-- presentation of a specific kind of object. These
|
||||
-- factors involved include color, width and type of line,
|
||||
-- and maximal chordal deviation. The Drawer includes
|
||||
-- instances of the aspect classes providing the default
|
||||
-- values for them.
|
||||
-- Prs3d_Drawer completes AIS_Drawer by adding
|
||||
-- functions for setting deviation angle and deviation
|
||||
-- coefficient in presentations using hidden line removal.
|
||||
|
||||
uses
|
||||
Drawer from Prs3d,
|
||||
DatumAspect from Prs3d,
|
||||
LineAspect from Prs3d,
|
||||
TextAspect from Prs3d,
|
||||
PointAspect from Prs3d,
|
||||
ShadingAspect from Prs3d,
|
||||
IsoAspect from Prs3d,
|
||||
DimensionAspect from Prs3d,
|
||||
PlaneAspect from Prs3d,
|
||||
ArrowAspect from Prs3d,
|
||||
TypeOfDeflection from Aspect,
|
||||
NameOfColor from Quantity,
|
||||
PlaneAngle from Quantity,
|
||||
Length from Quantity,
|
||||
DimensionUnits from Prs3d,
|
||||
VertexDrawMode from Prs3d,
|
||||
AsciiString from TCollection,
|
||||
TypeOfHLR from Prs3d,
|
||||
Ax2 from gp
|
||||
|
||||
is
|
||||
Create returns Drawer from AIS;
|
||||
---Purpose:
|
||||
-- Constructs an empty attribute management framework.
|
||||
TypeOfDeflection(me) returns TypeOfDeflection from Aspect
|
||||
is redefined static;
|
||||
--- Purpose:
|
||||
-- Returns the type of chordal deflection: relative to the
|
||||
-- size of the object or absolute.
|
||||
|
||||
MaximalChordialDeviation (me) returns Length from Quantity
|
||||
---Purpose: Returns the maximal chordal deviation. The default
|
||||
-- value is 0.1. Drawings of curves or patches are
|
||||
-- made with respect to an absolute maximal chordal deviation.
|
||||
is redefined static;
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
SetDeviationCoefficient(me: mutable) ;
|
||||
---Purpose: Sets the hasOwnDeviationCoefficient flag to Standard_False
|
||||
---C++: inline
|
||||
|
||||
SetHLRDeviationCoefficient(me: mutable) ;
|
||||
---Purpose: Sets the deviation coefficient aCoefficient for
|
||||
-- removal of hidden lines created by different
|
||||
-- viewpoints in different presentations. The Default value is 0.02.
|
||||
---C++: inline
|
||||
|
||||
SetDeviationAngle(me: mutable) ;
|
||||
---Purpose: Sets the hasOwnDeviationAngle flag to Standard_False
|
||||
---C++: inline
|
||||
|
||||
SetHLRAngle(me: mutable) ;
|
||||
---Purpose: Sets the angle of maximum chordal deviation for
|
||||
-- removal of hidden lines created by different viewpoints
|
||||
-- in different presentations. The default value is 20*PI/180.
|
||||
---C++: inline
|
||||
|
||||
SetDeviationCoefficient(me: mutable; aCoefficient: Real from Standard )
|
||||
---Purpose: Sets the hasOwnDeviationCoefficient flag to Standard_True,
|
||||
-- sets myOwnDeviationCoefficient and myPreviousDeviationCoefficient
|
||||
is redefined static;
|
||||
|
||||
SetHLRDeviationCoefficient(me: mutable; aCoefficient: Real from Standard )
|
||||
---Purpose: Sets the hasOwnHLRDeviationCoefficient flag to Standard_True,
|
||||
-- sets myOwnHLRDeviationCoefficient and myPreviousHLRDeviationCoefficient
|
||||
is redefined static;
|
||||
|
||||
SetDeviationAngle(me: mutable; anAngle: Real from Standard ) is redefined ;
|
||||
---Purpose: Sets the hasOwnDeviationAngle flag to Standard_True,
|
||||
-- sets myOwnDeviationAngle and myPreviousDeviationAngle
|
||||
|
||||
SetHLRAngle(me: mutable; anAngle: Real from Standard )
|
||||
---Purpose: Sets the hasOwnHLRDeviationAngle flag to Standard_True,
|
||||
-- sets myOwnHLRDeviationAngle and myPreviousHLRDeviationAngle
|
||||
is redefined static;
|
||||
|
||||
SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d)
|
||||
is redefined;
|
||||
---Purpose: Sets the type of HLR algorithm
|
||||
-- used by drawer's interactive objects
|
||||
---C++: inline
|
||||
|
||||
TypeOfHLR(me) returns TypeOfHLR from Prs3d
|
||||
is redefined;
|
||||
---Purpose: Returns the type of HLR algorithm currently in use.
|
||||
---C++: inline
|
||||
|
||||
DeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: Drawings of curves or patches are made with respect
|
||||
-- to a maximal chordal deviation. A Deviation coefficient
|
||||
-- is used in the shading display mode. The shape is
|
||||
-- seen decomposed into triangles. These are used to
|
||||
-- calculate reflection of light from the surface of the
|
||||
-- object. The triangles are formed from chords of the
|
||||
-- curves in the shape. The deviation coefficient gives
|
||||
-- the highest value of the angle with which a chord can
|
||||
-- deviate from a tangent to a curve. If this limit is
|
||||
-- reached, a new triangle is begun.
|
||||
-- This deviation is absolute and is set through the
|
||||
-- method: SetMaximalChordialDeviation. The default value is 0.001.
|
||||
-- In drawing shapes, however, you are allowed to ask
|
||||
-- for a relative deviation. This deviation will be:
|
||||
-- SizeOfObject * DeviationCoefficient.
|
||||
is redefined static;
|
||||
|
||||
HLRDeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: Returns the real number value of the HLR deviation
|
||||
-- coefficient in this framework, if the flag
|
||||
-- hasOwnHLRDeviationCoefficient is true.
|
||||
-- If hasOwnHLRDeviationCoefficient is false, the
|
||||
-- shape's HLR deviation coefficient is used.
|
||||
-- A Deviation coefficient is used in the shading display
|
||||
-- mode. The shape is seen decomposed into triangles.
|
||||
-- These are used to calculate reflection of light from the
|
||||
-- surface of the object.
|
||||
-- The triangles are formed from chords of the curves in
|
||||
-- the shape. The deviation coefficient give the highest
|
||||
-- value of the angle with which a chord can deviate
|
||||
-- from a tangent to a curve. If this limit is reached, a
|
||||
-- new triangle is begun.
|
||||
-- To find the hidden lines, hidden line display mode
|
||||
-- entails recalculation of the view at each different
|
||||
-- projector perspective.
|
||||
-- Since hidden lines entail calculations of more than
|
||||
-- usual complexity to decompose them into these
|
||||
-- triangles, a deviation coefficient allowing greater
|
||||
-- tolerance is used. This increases efficiency in calculation.
|
||||
-- The Default value is 0.02.
|
||||
is redefined static;
|
||||
|
||||
|
||||
DeviationAngle(me) returns Real from Standard
|
||||
---Purpose: Returns myOwnDeviationAngle if hasOwnDeviationAngle is True
|
||||
-- else gets myDeviationAngle field from Prs3d_Drawer
|
||||
is redefined;
|
||||
|
||||
HLRAngle(me) returns Real from Standard
|
||||
---Purpose: Returns the real number value of the deviation angle
|
||||
-- in hidden line removal views. The default value is 20*PI/180.
|
||||
is redefined static;
|
||||
|
||||
|
||||
PreviousDeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: Saves the previous value used for the chordal
|
||||
-- deviation coefficient. The default value is 0.1.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
PreviousHLRDeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: returns myPreviousHLRDeviationCoefficient
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
PreviousDeviationAngle(me) returns Real from Standard
|
||||
---Purpose: returns myPreviousDeviationAngle
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
PreviousHLRDeviationAngle(me) returns Real from Standard
|
||||
---Purpose: returns myPreviousHLRDeviationAngle
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
IsOwnDeviationCoefficient(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a local setting for deviation
|
||||
-- coefficient in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
IsOwnHLRDeviationCoefficient(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a setting for HLR deviation
|
||||
-- coefficient in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
IsOwnDeviationAngle(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a local setting for deviation
|
||||
-- angle in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
IsOwnHLRDeviationAngle(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a setting for HLR deviation
|
||||
-- angle in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
Discretisation(me) returns Integer from Standard
|
||||
is redefined static;
|
||||
---Purpose: Draws algorithms using discretisation, a default
|
||||
-- number of points has been set to 17. You can use the
|
||||
-- method Prs3d_Drawer_SetDiscretisation to change this value.
|
||||
|
||||
MaximalParameterValue(me) returns Real from Standard
|
||||
is redefined static;
|
||||
---Purpose:
|
||||
-- Sets the maximum value allowed for the first and last
|
||||
-- parameters of an infinite curve. By default, this value is 500000.
|
||||
|
||||
IsoOnPlane(me) returns Boolean from Standard
|
||||
---Purpose: returns True if the drawing of isos on planes is enabled.
|
||||
is redefined static;
|
||||
|
||||
|
||||
--
|
||||
-- Attributes for the U Isoparametric lines of patches.
|
||||
--
|
||||
UIsoAspect (me:mutable) returns IsoAspect from Prs3d
|
||||
---Purpose: Defines the attributes which are used when drawing an
|
||||
-- U isoparametric curve of a face. Defines the number
|
||||
-- of U isoparametric curves to be drawn for a single face.
|
||||
-- The LineAspect for U isoparametric lines can be edited
|
||||
-- (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
-- The default values are:
|
||||
-- COLOR : Quantity_NOC_GRAY75
|
||||
-- TYPE OF LINE: Aspect_TOL_SOLID
|
||||
-- WIDTH : 0.5
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFDeflectionSurface
|
||||
-- Prs3d_WFDeflectionRestrictedFace
|
||||
|
||||
|
||||
is redefined static;
|
||||
|
||||
HasUIsoAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a UIso aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
-- Attributes for the V Isoparametric line of patches.
|
||||
|
||||
|
||||
VIsoAspect (me:mutable) returns IsoAspect from Prs3d
|
||||
---Purpose: Defines the attributes which are used when drawing an
|
||||
-- V isoparametric curve of a face. Defines the number
|
||||
-- of V isoparametric curves to be drawn for a single face.
|
||||
-- The LineAspect for V isoparametric lines can be edited
|
||||
-- (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
-- The default values are:
|
||||
-- COLOR : Quantity_NOC_GRAY82
|
||||
-- TYPE OF LINE: Aspect_TOL_SOLID
|
||||
-- WIDTH : 0.5
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFDeflectionSurface
|
||||
-- Prs3d_WFDeflectionRestrictedFace
|
||||
is redefined static;
|
||||
|
||||
HasVIsoAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a VIso aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
-- Attributes for the free boundaries
|
||||
|
||||
FreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_FreeBoundaryAspect. Stores the
|
||||
-- values for presentation of free boundaries, in other
|
||||
-- words, boundaries which are not shared . The
|
||||
-- LineAspect for the free boundaries can be edited. The
|
||||
-- default values are: Color: Quantity_NOC_GREEN
|
||||
-- Type of line: Aspect_TOL_SOLID Width: 1.
|
||||
-- These attributes are used by Prs3d_WFShape.
|
||||
is redefined static;
|
||||
|
||||
HasFreeBoundaryAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a free boundary aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
FreeBoundaryDraw(me) returns Boolean from Standard
|
||||
---Purpose: returns True if the drawing of the free boundaries is enabled.
|
||||
is redefined static;
|
||||
|
||||
|
||||
-- Attributes for the wires
|
||||
|
||||
WireAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_WireAspect.
|
||||
-- This method provides wire aspect settings.
|
||||
-- The LineAspect for wires can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_RED
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFShape
|
||||
is redefined static;
|
||||
|
||||
HasLineAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Interactive Object has a line
|
||||
-- visualization aspect.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
HasWireAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a wire aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
WireDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns a link with Prs3d_Drawer_WireDraw. This
|
||||
-- method returns true if drawing of wires is enabled.
|
||||
-- The default setting is true.
|
||||
is redefined static;
|
||||
|
||||
|
||||
-- Attributes for the unfree boundaries
|
||||
|
||||
UnFreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_UnFreeBoundaryAspect, which
|
||||
-- provides settings for shared boundary line aspects.
|
||||
-- The LineAspect for shared boundaries can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFShape
|
||||
is redefined static;
|
||||
|
||||
HasUnFreeBoundaryAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has an unfree boundary aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
UnFreeBoundaryDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if the drawing of the shared boundaries
|
||||
-- is enabled. True is the default setting.
|
||||
is redefined static;
|
||||
|
||||
|
||||
--
|
||||
-- Attributes for the lines.
|
||||
--
|
||||
|
||||
LineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_LineAspect,
|
||||
-- which provides settings for line aspects. These
|
||||
-- settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_Curve
|
||||
-- Prs3d_Line
|
||||
-- Prs3d_HLRShape
|
||||
|
||||
is redefined static;
|
||||
|
||||
|
||||
|
||||
HasTextAspect(me) returns Boolean from Standard
|
||||
is static;
|
||||
---C++: inline
|
||||
TextAspect(me:mutable) returns TextAspect from Prs3d
|
||||
--
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
is redefined static;
|
||||
|
||||
LineArrowDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if the drawing of an arrow at the end of
|
||||
-- each line is enabled. The default setting is False.
|
||||
is redefined static;
|
||||
|
||||
ArrowAspect(me:mutable) returns ArrowAspect from Prs3d
|
||||
is redefined static;
|
||||
|
||||
|
||||
-- --
|
||||
-- Attributes for the points
|
||||
--
|
||||
PointAspect(me:mutable) returns PointAspect from Prs3d
|
||||
---Purpose: Returns the point aspect setting. The default values
|
||||
-- are: Color: Quantity_NOC_YELLOW
|
||||
-- Type of marker: Aspect_TOM_PLUS
|
||||
-- Scale: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_Point
|
||||
is redefined static;
|
||||
|
||||
HasPointAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a point aspect setting active.
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
SetVertexDrawMode(me: mutable; theMode: VertexDrawMode from Prs3d)
|
||||
---Purpose: Sets the mode of visualization of vertices by AIS_Shape and helper algorithms.
|
||||
-- By default, only isolated vertices not belonging to any face are drawn,
|
||||
-- that corresponds to <b>Prs3d_VDM_Isolated</b> mode.
|
||||
-- Switching to <b>Prs3d_VDM_Isolated</b> mode makes all shape's vertices visible.
|
||||
-- To inherit this parameter from the global drawer instance ("the link") when it is present,
|
||||
-- <b>Prs3d_VDM_Inherited</b> value should be used.
|
||||
is redefined static;
|
||||
|
||||
VertexDrawMode(me) returns VertexDrawMode from Prs3d
|
||||
---Purpose: Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
is redefined static;
|
||||
|
||||
IsOwnVertexDrawMode(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the vertex draw mode is not equal to <b>Prs3d_VDM_Inherited</b>.
|
||||
-- This means that individual vertex draw mode value (i.e. not inherited from the global
|
||||
-- drawer) is used for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
-- Attributes for the faces:
|
||||
--
|
||||
ShadingAspect (me:mutable) returns ShadingAspect from Prs3d
|
||||
---Purpose:
|
||||
-- Returns a link with Prs3d_Drawer_ShadingAspect,
|
||||
-- which provides settings for shading aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Material: Graphic3d_NOM_BRASS
|
||||
-- hading aspect is obtained through decomposition of
|
||||
-- 3D faces into triangles, each side of each triangle
|
||||
-- being a chord of the corresponding curved edge in
|
||||
-- the face. Reflection of light in each projector
|
||||
-- perspective is then calculated for each of the
|
||||
-- resultant triangular planes.
|
||||
is redefined static;
|
||||
|
||||
HasShadingAspect (me) returns Boolean from Standard
|
||||
---C++: inline
|
||||
---Purpose: Returns True if the Drawer has shading aspect active.
|
||||
is static;
|
||||
|
||||
ShadingAspectGlobal(me) returns Boolean from Standard
|
||||
is redefined static;
|
||||
---Purpose: Provides the attributes for hidden line removal.
|
||||
|
||||
|
||||
DrawHiddenLine(me) returns Boolean from Standard
|
||||
---Purpose: Returns Standard_True if the hidden lines are to be drawn.
|
||||
-- By default the hidden lines are not drawn.
|
||||
is redefined static;
|
||||
|
||||
HiddenLineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_HiddenLineAspect, which provides
|
||||
-- settings for hidden line aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_DASH
|
||||
-- Width: 1.
|
||||
is redefined static;
|
||||
|
||||
|
||||
SeenLineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_SeenLineAspect, which provides
|
||||
-- settings for seen line aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
is redefined static;
|
||||
|
||||
|
||||
HasPlaneAspect(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
PlaneAspect(me:mutable) returns PlaneAspect from Prs3d
|
||||
is redefined static;
|
||||
---Purpose:
|
||||
-- Returns a link with Prs3d_Drawer_PlaneAspect.
|
||||
-- This method provides settings for the appearance of planes.
|
||||
|
||||
|
||||
VectorAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_VectorAspect,
|
||||
-- which provides settings for the appearance of vectors.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_SKYBLUE
|
||||
-- Type of line: Aspect_TOL_SOLID Width: 1.
|
||||
is redefined static;
|
||||
|
||||
SetFaceBoundaryDraw (me : mutable;
|
||||
theIsEnabled : Boolean from Standard)
|
||||
is redefined static;
|
||||
---Purpose: Enables or disables drawing of face boundaries for shading presentations.
|
||||
-- The method sets drawing flag owned by the drawer that will be used during
|
||||
-- visualization instead of the one set in link.
|
||||
-- theIsEnabled is a boolean flag indicating whether the face boundaries should be
|
||||
-- drawn or not.
|
||||
|
||||
IsFaceBoundaryDraw (me) returns Boolean from Standard
|
||||
is redefined static;
|
||||
---Purpose: Checks whether the drawing of face boundaries is enabled or not.
|
||||
|
||||
SetFaceBoundaryAspect (me : mutable;
|
||||
theAspect : LineAspect from Prs3d)
|
||||
is redefined static;
|
||||
---Purpose: Sets line aspect for face boundaries.
|
||||
-- The method sets line aspect owned by the drawer that will be used during
|
||||
-- visualization instead of the one set in link.
|
||||
-- theAspect is the line aspect that determines the look of the face boundaries.
|
||||
|
||||
FaceBoundaryAspect (me : mutable) returns LineAspect from Prs3d
|
||||
is redefined static;
|
||||
---Purpose: Returns line aspect of face boundaries.
|
||||
|
||||
IsOwnFaceBoundaryDraw (me) returns Boolean from Standard
|
||||
is static;
|
||||
---Purpose: Returns true if the drawer has its own attribute for
|
||||
-- "draw face boundaries" flag that overrides the one in the link.
|
||||
---C++: inline
|
||||
|
||||
IsOwnFaceBoundaryAspect (me) returns Boolean from Standard
|
||||
is static;
|
||||
---Purpose: Returns true if the drawer has its own attribute for
|
||||
-- face boundaries aspect that overrides the one in the link.
|
||||
---C++: inline
|
||||
--
|
||||
-- Attributes for the presentation of a Datum.
|
||||
--
|
||||
|
||||
HasDatumAspect(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
DatumAspect(me:mutable) returns DatumAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_DatumAspect,
|
||||
-- which provides settings for the appearance of datums.
|
||||
-- These settings can be edited. The default values for
|
||||
-- the three axes are:
|
||||
-- Color: Quantity_NOC_PEACHPUFF
|
||||
-- Type of line: Aspect_TOL_SOLID Width: 1.
|
||||
is redefined static;
|
||||
|
||||
--
|
||||
-- Attributes for the presentation of a dimensions.
|
||||
--
|
||||
|
||||
DimensionAspect (me : mutable) returns DimensionAspect from Prs3d is redefined static;
|
||||
---Purpose: Returns a link with Prs3d_Drawer_DimensionAspect,
|
||||
-- which provides settings for the appearance of dimensions.
|
||||
|
||||
HasDimensionAspect (me) returns Boolean from Standard is static;
|
||||
---C++: inline
|
||||
-- Purpose: Returns true if the Drawer has a dimension aspect setting active.
|
||||
|
||||
SetDimLengthModelUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets dimension length model units for computing of dimension presentation.
|
||||
|
||||
SetDimAngleModelUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets dimension angle model units for computing of dimension presentation.
|
||||
|
||||
DimAngleModelUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns angle model units for the dimension presentation.
|
||||
---C++: return const &
|
||||
|
||||
DimLengthModelUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns length model units for the dimension presentation.
|
||||
---C++: return const &
|
||||
|
||||
SetDimLengthDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets length units in which value for dimension presentation is displayed.
|
||||
|
||||
SetDimAngleDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets angle units in which value for dimension presentation is displayed.
|
||||
|
||||
DimLengthDisplayUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns length units in which dimension presentation is displayed.
|
||||
---C++: return const &
|
||||
|
||||
DimAngleDisplayUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns angle units in which dimension presentation is displayed.
|
||||
---C++: return const &
|
||||
|
||||
-- Attributes for the sections
|
||||
|
||||
SectionAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_SectionAspect,
|
||||
-- which provides settings for wires which highlight sections.
|
||||
-- The LineAspect for the wire can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_ORANGE
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFShape
|
||||
is redefined static;
|
||||
|
||||
Link(me:mutable) returns any Drawer from Prs3d
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
HasLink(me) returns Boolean from Standard
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
Link (me:mutable; aDrawer: Drawer from Prs3d)
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
|
||||
ClearLocalAttributes(me:mutable) is virtual;
|
||||
---Purpose: Removes attributes stored in a Local Context.
|
||||
|
||||
WasLastLocal(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose: Returns true if the last called attribute was local; false if it was global.
|
||||
|
||||
HasLocalAttributes(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns true if a Local Context has stored attributes
|
||||
-- for Interactive Objects.
|
||||
|
||||
fields
|
||||
|
||||
myLink : Drawer from Prs3d;
|
||||
hasLocalAttributes : Boolean from Standard;
|
||||
|
||||
myhasOwnDeviationCoefficient : Boolean from Standard;
|
||||
myOwnDeviationCoefficient : Real from Standard;
|
||||
myPreviousDeviationCoefficient : Real from Standard;
|
||||
|
||||
myhasOwnHLRDeviationCoefficient : Boolean from Standard;
|
||||
myOwnHLRDeviationCoefficient : Real from Standard;
|
||||
myPreviousHLRDeviationCoefficient: Real from Standard;
|
||||
|
||||
myhasOwnDeviationAngle : Boolean from Standard;
|
||||
myOwnDeviationAngle : Real from Standard;
|
||||
myPreviousDeviationAngle : Real from Standard;
|
||||
|
||||
myhasOwnHLRDeviationAngle : Boolean from Standard;
|
||||
myOwnHLRDeviationAngle : Real from Standard;
|
||||
myPreviousHLRDeviationAngle : Real from Standard;
|
||||
myHasOwnFaceBoundaryDraw : Boolean from Standard;
|
||||
|
||||
myHasOwnDimLengthModelUnits : Boolean from Standard;
|
||||
myHasOwnDimLengthDisplayUnits : Boolean from Standard;
|
||||
myHasOwnDimAngleModelUnits : Boolean from Standard;
|
||||
myHasOwnDimAngleDisplayUnits : Boolean from Standard;
|
||||
|
||||
end Drawer;
|
||||
|
||||
|
@ -1,418 +0,0 @@
|
||||
// Copyright (c) 1998-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Drawer.ixx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : AIS_Drawer
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
AIS_Drawer::AIS_Drawer()
|
||||
: myLink (new Prs3d_Drawer()),
|
||||
hasLocalAttributes (Standard_False),
|
||||
myhasOwnDeviationCoefficient (Standard_False),
|
||||
myPreviousDeviationCoefficient (0.1),
|
||||
myhasOwnHLRDeviationCoefficient (Standard_False),
|
||||
myhasOwnDeviationAngle (Standard_False),
|
||||
myhasOwnHLRDeviationAngle (Standard_False),
|
||||
myHasOwnFaceBoundaryDraw (Standard_False),
|
||||
myHasOwnDimLengthModelUnits (Standard_False),
|
||||
myHasOwnDimLengthDisplayUnits (Standard_False),
|
||||
myHasOwnDimAngleModelUnits (Standard_False),
|
||||
myHasOwnDimAngleDisplayUnits (Standard_False)
|
||||
{
|
||||
SetMaximalParameterValue (500000.0);
|
||||
myLink->SetMaximalParameterValue (500000.0);
|
||||
SetTypeOfHLR (Prs3d_TOH_NotSet);
|
||||
SetVertexDrawMode (Prs3d_VDM_Inherited);
|
||||
}
|
||||
|
||||
Aspect_TypeOfDeflection AIS_Drawer::TypeOfDeflection () const
|
||||
{
|
||||
return myLink->TypeOfDeflection();
|
||||
}
|
||||
|
||||
Standard_Boolean AIS_Drawer::IsoOnPlane() const
|
||||
{
|
||||
return myLink->IsoOnPlane();
|
||||
}
|
||||
|
||||
Standard_Integer AIS_Drawer::Discretisation() const
|
||||
{
|
||||
return myLink->Discretisation();
|
||||
}
|
||||
|
||||
Quantity_Length AIS_Drawer::MaximalChordialDeviation() const
|
||||
{
|
||||
return myLink->MaximalChordialDeviation();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetDeviationCoefficient ( const Standard_Real aCoefficient )
|
||||
{
|
||||
myPreviousDeviationCoefficient = DeviationCoefficient() ;
|
||||
myOwnDeviationCoefficient = aCoefficient ;
|
||||
myhasOwnDeviationCoefficient = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetHLRDeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetHLRDeviationCoefficient ( const Standard_Real aCoefficient )
|
||||
{
|
||||
myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient() ;
|
||||
myOwnHLRDeviationCoefficient = aCoefficient ;
|
||||
myhasOwnHLRDeviationCoefficient = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDeviationAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetDeviationAngle ( const Standard_Real anAngle )
|
||||
{
|
||||
myPreviousDeviationAngle = DeviationAngle() ;
|
||||
myOwnDeviationAngle = anAngle ;
|
||||
myhasOwnDeviationAngle = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetHLRAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetHLRAngle ( const Standard_Real anAngle )
|
||||
{
|
||||
myPreviousHLRDeviationAngle = HLRAngle() ;
|
||||
myOwnHLRDeviationAngle = anAngle ;
|
||||
myhasOwnHLRDeviationAngle = Standard_True;
|
||||
}
|
||||
|
||||
/////// Get
|
||||
//=======================================================================
|
||||
//function : DeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::DeviationCoefficient () const
|
||||
{
|
||||
return myhasOwnDeviationCoefficient? myOwnDeviationCoefficient :myLink->DeviationCoefficient();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HLRDeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::HLRDeviationCoefficient () const
|
||||
{
|
||||
return myhasOwnHLRDeviationCoefficient?myOwnHLRDeviationCoefficient : myLink->HLRDeviationCoefficient() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DeviationAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::DeviationAngle () const
|
||||
{
|
||||
return myhasOwnDeviationAngle ? myOwnDeviationAngle : myLink->DeviationAngle();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HLRAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::HLRAngle () const
|
||||
{
|
||||
|
||||
return myhasOwnHLRDeviationAngle ? myOwnHLRDeviationAngle : myLink->HLRAngle();
|
||||
}
|
||||
|
||||
Standard_Real AIS_Drawer::MaximalParameterValue () const
|
||||
{ return myLink->MaximalParameterValue();}
|
||||
|
||||
Handle (Prs3d_IsoAspect) AIS_Drawer::UIsoAspect ()
|
||||
{ return myUIsoAspect.IsNull() ? myLink->UIsoAspect (): myUIsoAspect;}
|
||||
|
||||
Handle (Prs3d_IsoAspect) AIS_Drawer::VIsoAspect ()
|
||||
{ return myVIsoAspect.IsNull() ? myLink->VIsoAspect (): myVIsoAspect;}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::FreeBoundaryAspect ()
|
||||
{return myFreeBoundaryAspect.IsNull() ? myLink->FreeBoundaryAspect (): myFreeBoundaryAspect;}
|
||||
|
||||
Standard_Boolean AIS_Drawer::FreeBoundaryDraw () const
|
||||
{return myLink->FreeBoundaryDraw();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::UnFreeBoundaryAspect ()
|
||||
{return myUnFreeBoundaryAspect.IsNull() ? myLink->UnFreeBoundaryAspect (): myUnFreeBoundaryAspect;}
|
||||
|
||||
Standard_Boolean AIS_Drawer::UnFreeBoundaryDraw () const
|
||||
{return myLink->UnFreeBoundaryDraw ();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::WireAspect ()
|
||||
{ return myWireAspect.IsNull()? myLink->WireAspect (): myWireAspect;}
|
||||
|
||||
Standard_Boolean AIS_Drawer::WireDraw () const
|
||||
{ return myLink->WireDraw();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::LineAspect ()
|
||||
{ return myLineAspect.IsNull() ? myLink->LineAspect (): myLineAspect;}
|
||||
|
||||
Handle (Prs3d_TextAspect) AIS_Drawer::TextAspect ()
|
||||
{ return myTextAspect.IsNull() ? myLink->TextAspect () : myTextAspect ;}
|
||||
|
||||
Handle (Prs3d_ShadingAspect) AIS_Drawer::ShadingAspect ()
|
||||
{
|
||||
return myShadingAspect.IsNull() ? myLink->ShadingAspect () : myShadingAspect ;
|
||||
}
|
||||
|
||||
Standard_Boolean AIS_Drawer::ShadingAspectGlobal() const
|
||||
{ return myLink->ShadingAspectGlobal();}
|
||||
|
||||
|
||||
Standard_Boolean AIS_Drawer::LineArrowDraw () const
|
||||
{ return myLink->LineArrowDraw();}
|
||||
|
||||
Handle (Prs3d_ArrowAspect) AIS_Drawer::ArrowAspect()
|
||||
{return myArrowAspect.IsNull()? myLink->ArrowAspect () : myArrowAspect;}
|
||||
|
||||
Handle (Prs3d_PointAspect) AIS_Drawer::PointAspect()
|
||||
{return myPointAspect.IsNull()? myLink->PointAspect () : myPointAspect;}
|
||||
|
||||
void AIS_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
|
||||
{
|
||||
// Assuming that myLink always exists --> Prs3d_VDM_Inherited value is acceptable.
|
||||
// So we simply store the new mode, as opposed to Prs3d_Drawer::SetVertexDrawMode()
|
||||
myVertexDrawMode = theMode;
|
||||
}
|
||||
|
||||
Prs3d_VertexDrawMode AIS_Drawer::VertexDrawMode () const
|
||||
{
|
||||
return IsOwnVertexDrawMode() ? myVertexDrawMode : myLink->VertexDrawMode();
|
||||
}
|
||||
|
||||
Standard_Boolean AIS_Drawer::DrawHiddenLine () const
|
||||
{return myLink->DrawHiddenLine();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::HiddenLineAspect ()
|
||||
{return myHiddenLineAspect.IsNull()? myLink->HiddenLineAspect () : myHiddenLineAspect;}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::SeenLineAspect ()
|
||||
{ return mySeenLineAspect.IsNull() ? myLink->SeenLineAspect (): mySeenLineAspect ;}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::VectorAspect ()
|
||||
{return myVectorAspect.IsNull()? myLink->VectorAspect () : myVectorAspect;}
|
||||
|
||||
Handle (Prs3d_DatumAspect) AIS_Drawer::DatumAspect ()
|
||||
{return myDatumAspect.IsNull()? myLink->DatumAspect () : myDatumAspect; }
|
||||
|
||||
Handle (Prs3d_PlaneAspect) AIS_Drawer::PlaneAspect ()
|
||||
{return myPlaneAspect.IsNull() ? myLink->PlaneAspect (): myPlaneAspect;}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimensionAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle (Prs3d_DimensionAspect) AIS_Drawer::DimensionAspect()
|
||||
{
|
||||
return myDimensionAspect.IsNull()? myLink->DimensionAspect () : myDimensionAspect;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimAngleModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimAngleModelUnits() const
|
||||
{
|
||||
return myHasOwnDimAngleModelUnits
|
||||
? Prs3d_Drawer::DimAngleModelUnits()
|
||||
: myLink->DimAngleModelUnits();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimensionModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimLengthModelUnits() const
|
||||
{
|
||||
return myHasOwnDimLengthModelUnits
|
||||
? Prs3d_Drawer::DimLengthModelUnits()
|
||||
: myLink->DimLengthModelUnits();
|
||||
}
|
||||
// =======================================================================
|
||||
// function : SetDimLengthModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimLengthModelUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimLengthModelUnits (theUnits);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDimAngleModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimAngleModelUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimAngleModelUnits (theUnits);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimAngleDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimAngleDisplayUnits() const
|
||||
{
|
||||
return myHasOwnDimAngleDisplayUnits
|
||||
? Prs3d_Drawer::DimAngleDisplayUnits()
|
||||
: myLink->DimAngleDisplayUnits();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimLengthDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimLengthDisplayUnits() const
|
||||
{
|
||||
return myHasOwnDimLengthDisplayUnits
|
||||
? Prs3d_Drawer::DimLengthDisplayUnits()
|
||||
: myLink->DimLengthDisplayUnits();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDimLengthDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimLengthDisplayUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimLengthDisplayUnits (theUnits);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDimAngleDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimAngleDisplayUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimAngleDisplayUnits (theUnits);
|
||||
}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::SectionAspect ()
|
||||
{return mySectionAspect.IsNull()? myLink->SectionAspect (): mySectionAspect;}
|
||||
|
||||
const Handle (Prs3d_Drawer)& AIS_Drawer::Link()
|
||||
{
|
||||
if(myLink.IsNull()) myLink = new Prs3d_Drawer();
|
||||
return myLink;
|
||||
}
|
||||
|
||||
void AIS_Drawer::ClearLocalAttributes()
|
||||
{
|
||||
if(myLink.IsNull()) return;
|
||||
// attention pas beau....
|
||||
// The Handles
|
||||
|
||||
if(!myUIsoAspect.IsNull()) myUIsoAspect.Nullify();
|
||||
if(!myVIsoAspect.IsNull()) myVIsoAspect.Nullify();
|
||||
if(!myFreeBoundaryAspect.IsNull()) myFreeBoundaryAspect.Nullify();
|
||||
if(!myUnFreeBoundaryAspect.IsNull()) myUnFreeBoundaryAspect.Nullify();
|
||||
if(!myWireAspect.IsNull()) myWireAspect.Nullify();
|
||||
if(!myLineAspect.IsNull()) myLineAspect.Nullify();
|
||||
if(!myTextAspect.IsNull()) myTextAspect.Nullify();
|
||||
if(!myShadingAspect.IsNull()) myShadingAspect.Nullify();
|
||||
if(!myPointAspect.IsNull()) myPointAspect.Nullify();
|
||||
if(!myPlaneAspect.IsNull()) myPlaneAspect.Nullify();
|
||||
if(!myArrowAspect.IsNull()) myArrowAspect.Nullify();
|
||||
if(!myHiddenLineAspect.IsNull()) myHiddenLineAspect.Nullify();
|
||||
if(!mySeenLineAspect.IsNull()) mySeenLineAspect.Nullify();
|
||||
if(!myVectorAspect.IsNull()) myVectorAspect .Nullify();
|
||||
if(!myDatumAspect.IsNull()) myDatumAspect.Nullify();
|
||||
if(!myDimensionAspect.IsNull()) myDimensionAspect.Nullify();
|
||||
if(!mySectionAspect.IsNull()) mySectionAspect.Nullify();
|
||||
if( myhasOwnHLRDeviationCoefficient ) myhasOwnHLRDeviationCoefficient = Standard_False;
|
||||
if(myhasOwnHLRDeviationAngle ) myhasOwnHLRDeviationAngle = Standard_False;
|
||||
if (!myFaceBoundaryAspect.IsNull()) myFaceBoundaryAspect.Nullify();
|
||||
|
||||
myHasOwnFaceBoundaryDraw = Standard_False;
|
||||
myHasOwnDimLengthModelUnits = Standard_False;
|
||||
myHasOwnDimLengthDisplayUnits = Standard_False;
|
||||
myHasOwnDimAngleModelUnits = Standard_False;
|
||||
myHasOwnDimAngleDisplayUnits = Standard_False;
|
||||
|
||||
hasLocalAttributes = Standard_False;
|
||||
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetFaceBoundaryDraw
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
|
||||
{
|
||||
myHasOwnFaceBoundaryDraw = Standard_True;
|
||||
myFaceBoundaryDraw = theIsEnabled;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : IsFaceBoundaryDraw
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean AIS_Drawer::IsFaceBoundaryDraw() const
|
||||
{
|
||||
if (!IsOwnFaceBoundaryDraw ())
|
||||
{
|
||||
return myLink->IsFaceBoundaryDraw ();
|
||||
}
|
||||
|
||||
return myFaceBoundaryDraw;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetFaceBoundaryAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myFaceBoundaryAspect = theAspect;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : FaceBoundaryAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(Prs3d_LineAspect) AIS_Drawer::FaceBoundaryAspect()
|
||||
{
|
||||
if (!IsOwnFaceBoundaryAspect ())
|
||||
{
|
||||
return myLink->FaceBoundaryAspect ();
|
||||
}
|
||||
|
||||
return myFaceBoundaryAspect;
|
||||
}
|
@ -1,180 +0,0 @@
|
||||
// Created on: 1996-12-19
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::WasLastLocal() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasLocalAttributes() const
|
||||
{
|
||||
return hasLocalAttributes;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnDeviationCoefficient ? myPreviousDeviationCoefficient : 0.0;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousHLRDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnHLRDeviationCoefficient ? myPreviousHLRDeviationCoefficient : 0.0;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousDeviationAngle() const
|
||||
{
|
||||
return myhasOwnDeviationAngle ? myPreviousDeviationAngle : 0.0;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousHLRDeviationAngle() const
|
||||
{
|
||||
return myhasOwnHLRDeviationAngle ? myPreviousHLRDeviationAngle : 0.0;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::Link (const Handle(Prs3d_Drawer)& theDrawer)
|
||||
{
|
||||
myLink = theDrawer;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasLink() const
|
||||
{
|
||||
return !myLink.IsNull();
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetDeviationCoefficient()
|
||||
{
|
||||
myhasOwnDeviationCoefficient = Standard_False;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetHLRDeviationCoefficient()
|
||||
{
|
||||
myhasOwnHLRDeviationCoefficient = Standard_False;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetDeviationAngle()
|
||||
{
|
||||
myhasOwnDeviationAngle = Standard_False;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetHLRAngle()
|
||||
{
|
||||
myhasOwnHLRDeviationAngle = Standard_False;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnDeviationCoefficient;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnDeviationAngle() const
|
||||
{
|
||||
return myhasOwnDeviationAngle;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnHLRDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnHLRDeviationCoefficient;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnHLRDeviationAngle() const
|
||||
{
|
||||
return myhasOwnHLRDeviationAngle;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasTextAspect() const
|
||||
{
|
||||
return !myTextAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasWireAspect() const
|
||||
{
|
||||
return !myWireAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasLineAspect() const
|
||||
{
|
||||
return !myLineAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasShadingAspect() const
|
||||
{
|
||||
return !myShadingAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasPointAspect() const
|
||||
{
|
||||
return !myPointAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnVertexDrawMode() const
|
||||
{
|
||||
return (myVertexDrawMode != Prs3d_VDM_Inherited);
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasDatumAspect() const
|
||||
{
|
||||
return !myDatumAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasPlaneAspect() const
|
||||
{
|
||||
return !myPlaneAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasUIsoAspect() const
|
||||
{
|
||||
return !myUIsoAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasVIsoAspect() const
|
||||
{
|
||||
return !myVIsoAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasFreeBoundaryAspect() const
|
||||
{
|
||||
return !myFreeBoundaryAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasUnFreeBoundaryAspect() const
|
||||
{
|
||||
return !myUnFreeBoundaryAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryDraw() const
|
||||
{
|
||||
return myHasOwnFaceBoundaryDraw;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryAspect() const
|
||||
{
|
||||
return !myFaceBoundaryAspect.IsNull();
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)
|
||||
{
|
||||
myTypeOfHLR = theTypeOfHLR;
|
||||
}
|
||||
|
||||
inline Prs3d_TypeOfHLR AIS_Drawer::TypeOfHLR() const
|
||||
{
|
||||
return (myTypeOfHLR == Prs3d_TOH_NotSet) ? myLink->TypeOfHLR() : myTypeOfHLR;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasDimensionAspect() const
|
||||
{
|
||||
return !myDimensionAspect.IsNull();
|
||||
}
|
@ -26,12 +26,12 @@ uses
|
||||
Shape from TopoDS,
|
||||
Plane from Geom,
|
||||
PresentationManager3d from PrsMgr,
|
||||
Drawer from Prs3d,
|
||||
Presentation from Prs3d,
|
||||
Projector from Prs3d,
|
||||
Transformation from Geom,
|
||||
Selection from SelectMgr,
|
||||
Pnt from gp,
|
||||
Drawer from AIS,
|
||||
ExtendedString from TCollection,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
@ -118,7 +118,7 @@ is
|
||||
-- ota -- begin
|
||||
ComputeTwoEdgesLength (myclass;
|
||||
aPresentation : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
ArrowSize : Real from Standard;
|
||||
FirstEdge : Edge from TopoDS;
|
||||
SecondEdge : Edge from TopoDS;
|
||||
@ -138,7 +138,7 @@ is
|
||||
|
||||
ComputeTwoVerticesLength(myclass;
|
||||
aPresentation : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
ArrowSize : Real from Standard;
|
||||
FirstVertex : Vertex from TopoDS;
|
||||
SecondVertex : Vertex from TopoDS;
|
||||
@ -158,7 +158,7 @@ is
|
||||
|
||||
ComputeOneEdgeOneVertexLength(myclass;
|
||||
aPresentation : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
ArrowSize : Real from Standard;
|
||||
FirstShape : Shape from TopoDS;
|
||||
SecondShape : Shape from TopoDS;
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
//=======================================================================
|
||||
//function : AIS_EqualDistanceRelation
|
||||
@ -363,7 +363,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const Standard_Real ArrowSize,
|
||||
const TopoDS_Edge & FirstEdge,
|
||||
const TopoDS_Edge & SecondEdge,
|
||||
@ -591,7 +591,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
|
||||
//=======================================================================
|
||||
|
||||
void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const Standard_Real ArrowSize,
|
||||
const TopoDS_Vertex& FirstVertex,
|
||||
const TopoDS_Vertex& SecondVertex,
|
||||
@ -682,7 +682,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
|
||||
//=======================================================================
|
||||
|
||||
void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const Standard_Real ArrowSize,
|
||||
const TopoDS_Shape & FirstShape,
|
||||
const TopoDS_Shape & SecondShape,
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : AIS_EqualRadiusRelation
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
|
@ -99,7 +99,6 @@ uses
|
||||
MapOfInteractive from AIS,
|
||||
InteractiveObject from AIS,
|
||||
DisplayMode from AIS,
|
||||
Drawer from AIS,
|
||||
NameOfMaterial from Graphic3d,
|
||||
--NameOfPhysicalMaterial from Graphic3d,
|
||||
Filter from SelectMgr,
|
||||
@ -607,7 +606,7 @@ is
|
||||
|
||||
SetLocalAttributes(me : mutable;
|
||||
aniobj : InteractiveObject from AIS;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
updateviewer : Boolean from Standard = Standard_True);
|
||||
--- Purpose:
|
||||
-- Sets the attributes of the interactive object aniobj by
|
||||
@ -946,7 +945,7 @@ is
|
||||
-- deviate from a tangent to a curve. If this limit is
|
||||
-- reached, a new triangle is begun.
|
||||
-- This deviation is absolute and is set through
|
||||
-- AIS_Drawer::SetMaximalChordialDeviation. The
|
||||
-- Prs3d_Drawer::SetMaximalChordialDeviation. The
|
||||
-- default value is 0.001.
|
||||
-- In drawing shapes, however, you are allowed to ask
|
||||
-- for a relative deviation. This deviation will be:
|
||||
|
@ -2131,7 +2131,7 @@ void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)&
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetLocalAttributes (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Handle(AIS_Drawer)& theDrawer,
|
||||
const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Boolean theToUpdateViewer)
|
||||
{
|
||||
if (theIObj.IsNull())
|
||||
|
@ -53,7 +53,6 @@ uses
|
||||
Box from Bnd,
|
||||
NameOfMaterial from Graphic3d,
|
||||
MaterialAspect from Graphic3d,
|
||||
Drawer from AIS,
|
||||
PToContext from AIS,
|
||||
TypeOfPresentation3d from PrsMgr,
|
||||
InteractiveContext from AIS,
|
||||
@ -485,16 +484,8 @@ is
|
||||
|
||||
UnsetTransparency(me:mutable) is virtual;
|
||||
---Purpose: Removes the transparency setting. The object is opaque by default.
|
||||
|
||||
SetAttributes(me:mutable; aDrawer: Drawer from AIS) is virtual;
|
||||
---Purpose: Initializes the drawing tool aDrawer.
|
||||
|
||||
Attributes(me) returns any Drawer from AIS;
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
---Purpose: Returns the attributes settings.
|
||||
|
||||
UnsetAttributes(me:mutable) is virtual;
|
||||
|
||||
UnsetAttributes(me:mutable) is redefined virtual;
|
||||
---Purpose: Clears settings provided by the drawing tool aDrawer.
|
||||
|
||||
---Category: information about Prs to be recomputed
|
||||
@ -597,7 +588,6 @@ fields
|
||||
|
||||
-- The Information Fields
|
||||
|
||||
myDrawer : Drawer from AIS is protected ;
|
||||
myTransparency : Real from Standard is protected;
|
||||
myOwnColor : Color from Quantity is protected;
|
||||
myOwnMaterial : NameOfMaterial from Graphic3d is protected;
|
||||
|
@ -45,7 +45,6 @@
|
||||
AIS_InteractiveObject::
|
||||
AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
|
||||
SelectMgr_SelectableObject(aTypeOfPresentation3d),
|
||||
myDrawer(new AIS_Drawer()),
|
||||
myTransparency(0.),
|
||||
myOwnColor(Quantity_NOC_WHITE),
|
||||
myOwnMaterial(Graphic3d_NOM_DEFAULT),
|
||||
@ -130,12 +129,6 @@ void AIS_InteractiveObject::SetContext(const Handle(AIS_InteractiveContext)& aCt
|
||||
myCTXPtr = aCtx.operator->();
|
||||
if( aCtx.IsNull())
|
||||
return;
|
||||
if (myDrawer.IsNull()) {
|
||||
myDrawer = new AIS_Drawer;
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "AIS_InteractiveObject::SetContext DRAWER NUL!" << endl;
|
||||
#endif
|
||||
}
|
||||
myDrawer->Link(aCtx->DefaultDrawer());
|
||||
}
|
||||
|
||||
@ -285,15 +278,14 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
//void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfPhysicalMaterial aName)
|
||||
{
|
||||
if( HasColor() || IsTransparent() || HasMaterial() )
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
myOwnMaterial = aName;
|
||||
hasOwnMaterial = Standard_True;
|
||||
}
|
||||
@ -304,17 +296,16 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
|
||||
void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
|
||||
{
|
||||
if( HasColor() || IsTransparent() || HasMaterial() )
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
if (HasColor() || IsTransparent() || HasMaterial())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
hasOwnMaterial = Standard_True;
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function :
|
||||
@ -323,11 +314,14 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
|
||||
void AIS_InteractiveObject::UnsetMaterial()
|
||||
{
|
||||
if( !HasMaterial() ) return;
|
||||
if( HasColor() || IsTransparent()) {
|
||||
myDrawer->ShadingAspect()->SetMaterial(
|
||||
AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
if( HasColor() ) SetColor(myOwnColor);
|
||||
if( IsTransparent() ) SetTransparency(myTransparency);
|
||||
if (HasColor() || IsTransparent())
|
||||
{
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (AIS_GraphicTool::GetMaterial (myDrawer->Link()));
|
||||
}
|
||||
if (HasColor()) SetColor (myOwnColor);
|
||||
if (IsTransparent()) SetTransparency (myTransparency);
|
||||
}
|
||||
else{
|
||||
Handle(Prs3d_ShadingAspect) SA;
|
||||
@ -342,12 +336,11 @@ void AIS_InteractiveObject::UnsetMaterial()
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
|
||||
{
|
||||
|
||||
|
||||
if(!HasColor() && !IsTransparent() && !HasMaterial() ) {
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
if(!myDrawer->Link().IsNull())
|
||||
myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
if(!HasColor() && !IsTransparent() && !HasMaterial())
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
if(myDrawer->HasLink())
|
||||
myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
}
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
@ -363,14 +356,14 @@ void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetTransparency()
|
||||
{
|
||||
if(HasColor() || HasMaterial() )
|
||||
{
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
FMat.SetTransparency(0.); BMat.SetTransparency(0.);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
}
|
||||
if(HasColor() || HasMaterial() )
|
||||
{
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
FMat.SetTransparency(0.); BMat.SetTransparency(0.);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
}
|
||||
else{
|
||||
Handle (Prs3d_ShadingAspect) SA;
|
||||
myDrawer->SetShadingAspect(SA);
|
||||
@ -388,25 +381,14 @@ Standard_Real AIS_InteractiveObject::Transparency() const
|
||||
// return Mat.Transparency();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetAttributes(const Handle(AIS_Drawer)& aDrawer)
|
||||
{myDrawer = aDrawer;}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetAttributes()
|
||||
{
|
||||
Handle(AIS_Drawer) dr = new AIS_Drawer();
|
||||
if(myDrawer->HasLink())
|
||||
dr->Link(myDrawer->Link());
|
||||
myDrawer = dr;
|
||||
SelectMgr_SelectableObject::UnsetAttributes();
|
||||
|
||||
hasOwnColor = Standard_False;
|
||||
hasOwnMaterial = Standard_False;
|
||||
myOwnWidth = 0.0;
|
||||
@ -588,7 +570,7 @@ void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer aMode,
|
||||
Standard_Boolean AIS_InteractiveObject::HasPolygonOffsets() const
|
||||
{
|
||||
return !( myDrawer->ShadingAspect().IsNull() ||
|
||||
( !myDrawer->Link().IsNull() &&
|
||||
( myDrawer->HasLink() &&
|
||||
myDrawer->ShadingAspect() == myDrawer->Link()->ShadingAspect() ) );
|
||||
}
|
||||
|
||||
|
@ -78,10 +78,6 @@ inline Graphic3d_NameOfMaterial AIS_InteractiveObject::Material() const
|
||||
//inline Graphic3d_NameOfPhysicalMaterial AIS_InteractiveObject::Material() const
|
||||
{return myOwnMaterial;}
|
||||
|
||||
inline const Handle(AIS_Drawer)&
|
||||
AIS_InteractiveObject::Attributes() const
|
||||
{return myDrawer;}
|
||||
|
||||
inline Standard_Boolean AIS_InteractiveObject::HasHilightMode() const
|
||||
{return myHilightMode!=-1;}
|
||||
|
||||
|
@ -16,13 +16,13 @@
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Dimension.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
@ -44,7 +44,6 @@ class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class SelectMgr_Selection;
|
||||
class AIS_Drawer;
|
||||
class Bnd_Box;
|
||||
class gp_Dir;
|
||||
class TopoDS_Vertex;
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <GC_MakeSegment.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
@ -167,9 +166,10 @@ void AIS_Line::SetColor(const Quantity_Color &aCol)
|
||||
myOwnColor=aCol;
|
||||
|
||||
Standard_Real WW = HasWidth()? myOwnWidth:
|
||||
AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
||||
|
||||
if (!myDrawer->HasLineAspect ())
|
||||
if (!myDrawer->HasOwnLineAspect ())
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
else
|
||||
myDrawer->LineAspect()->SetColor(aCol);
|
||||
@ -188,9 +188,9 @@ void AIS_Line::UnsetColor()
|
||||
|
||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Quantity_Color CC;
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->LineAspect()->SetColor(CC);
|
||||
myOwnColor = CC;
|
||||
}
|
||||
@ -204,11 +204,11 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
|
||||
{
|
||||
myOwnWidth=aValue;
|
||||
|
||||
if (!myDrawer->HasLineAspect ()) {
|
||||
Quantity_Color CC;
|
||||
if (!myDrawer->HasOwnLineAspect ()) {
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
||||
} else
|
||||
myDrawer->LineAspect()->SetWidth(aValue);
|
||||
}
|
||||
@ -224,7 +224,8 @@ void AIS_Line::UnsetWidth()
|
||||
|
||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Standard_Real WW = AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
Standard_Real WW = myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
||||
myDrawer->LineAspect()->SetWidth(WW);
|
||||
myOwnWidth = WW;
|
||||
}
|
||||
|
@ -56,7 +56,6 @@
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <DsgPrs_EllipseRadiusPresentation.hxx>
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <gce_MakeLin.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
@ -57,7 +57,6 @@
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <DsgPrs_EllipseRadiusPresentation.hxx>
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <AIS_OffsetDimension.ixx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <Select3D_SensitiveSegment.hxx>
|
||||
|
@ -53,8 +53,6 @@
|
||||
|
||||
#include <Poly_Triangulation.hxx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//=======================================================================
|
||||
@ -375,10 +373,10 @@ void AIS_Plane::SetSize(const Standard_Real aXLength,
|
||||
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();
|
||||
}
|
||||
@ -406,13 +404,16 @@ void AIS_Plane::UnsetSize()
|
||||
{
|
||||
|
||||
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(),
|
||||
@ -461,10 +462,10 @@ void AIS_Plane::SetColor(const Quantity_Color &aCol)
|
||||
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();
|
||||
}
|
||||
@ -491,12 +492,14 @@ void AIS_Plane::SetColor(const Quantity_Color &aCol)
|
||||
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);
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <UnitsAPI.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <StdPrs_Point.hxx>
|
||||
#include <Geom_Point.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
//=======================================================================
|
||||
@ -209,8 +208,9 @@ AcceptDisplayMode(const Standard_Integer aMode) const
|
||||
void AIS_Point::UpdatePointValues()
|
||||
{
|
||||
|
||||
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM){
|
||||
myDrawer->PointAspect().Nullify();
|
||||
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM)
|
||||
{
|
||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
||||
return;
|
||||
}
|
||||
Quantity_Color aCol;
|
||||
@ -232,7 +232,7 @@ void AIS_Point::UpdatePointValues()
|
||||
if(myHasTOM) aTOM = myTOM;
|
||||
|
||||
|
||||
if(myDrawer->HasPointAspect()){
|
||||
if(myDrawer->HasOwnPointAspect()){
|
||||
// CLE
|
||||
// const Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
||||
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
||||
|
@ -15,11 +15,11 @@
|
||||
|
||||
#include <AIS_PointCloud.hxx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
@ -153,15 +153,21 @@ void AIS_PointCloud::SetColor (const Quantity_Color& theColor)
|
||||
{
|
||||
AIS_InteractiveObject::SetColor(theColor);
|
||||
|
||||
if (!myDrawer->HasPointAspect())
|
||||
if (!myDrawer->HasOwnPointAspect())
|
||||
{
|
||||
myDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, theColor, 1.0));
|
||||
*myDrawer->PointAspect()->Aspect() = *myDrawer->Link()->PointAspect()->Aspect();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->PointAspect()->Aspect() = *myDrawer->Link()->PointAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!myDrawer->HasShadingAspect())
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
// Override color
|
||||
@ -220,20 +226,32 @@ void AIS_PointCloud::UnsetColor()
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity_Color aColor;
|
||||
Quantity_Color aColor = Quantity_NOC_YELLOW;
|
||||
Aspect_TypeOfMarker aType = Aspect_TOM_POINT;
|
||||
Standard_Real aScale = 1.0;
|
||||
myDrawer->Link()->PointAspect()->Aspect()->Values (aColor, aType, aScale);
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->Link()->PointAspect()->Aspect()->Values (aColor, aType, aScale);
|
||||
}
|
||||
myDrawer->PointAspect()->SetColor (aColor);
|
||||
}
|
||||
|
||||
if (HasMaterial()
|
||||
|| IsTransparent())
|
||||
{
|
||||
Graphic3d_MaterialAspect aMat = AIS_GraphicTool::GetMaterial (HasMaterial() ? myDrawer : myDrawer->Link());
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect aMat = aDefaultMat;
|
||||
if (HasMaterial() || myDrawer->HasLink())
|
||||
{
|
||||
aMat = AIS_GraphicTool::GetMaterial (HasMaterial() ? myDrawer : myDrawer->Link());
|
||||
}
|
||||
if (HasMaterial())
|
||||
{
|
||||
Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
Quantity_Color aColor = aDefaultMat.AmbientColor();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
}
|
||||
aMat.SetColor (aColor);
|
||||
}
|
||||
if (IsTransparent())
|
||||
@ -298,10 +316,13 @@ void AIS_PointCloud::SetMaterial (const Graphic3d_NameOfMaterial theMatName)
|
||||
//=======================================================================
|
||||
void AIS_PointCloud::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
{
|
||||
if (!myDrawer->HasShadingAspect())
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
hasOwnMaterial = Standard_True;
|
||||
|
||||
@ -350,7 +371,10 @@ void AIS_PointCloud::UnsetMaterial()
|
||||
if (HasColor()
|
||||
|| IsTransparent())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->HasLink() ?
|
||||
myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel) :
|
||||
aDefaultMat,
|
||||
myCurrentFacingModel);
|
||||
if (HasColor())
|
||||
{
|
||||
@ -408,7 +432,7 @@ void AIS_PointCloud::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
|
||||
}
|
||||
|
||||
Handle(Graphic3d_AspectMarker3d) aMarkerAspect = myDrawer->PointAspect()->Aspect();
|
||||
if (!myDrawer->HasPointAspect())
|
||||
if (!myDrawer->HasOwnPointAspect())
|
||||
{
|
||||
aMarkerAspect->SetType (Aspect_TOM_POINT);
|
||||
}
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#include <AIS_Relation.ixx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
@ -27,6 +26,7 @@
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
@ -81,7 +81,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)&
|
||||
const Aspect_TypeOfLine aProjTOL,
|
||||
const Aspect_TypeOfLine aCallTOL) const
|
||||
{
|
||||
if (!myDrawer->HasWireAspect()){
|
||||
if (!myDrawer->HasOwnWireAspect()){
|
||||
myDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aProjTOL,2.));}
|
||||
else {
|
||||
const Handle(Prs3d_LineAspect)& li = myDrawer->WireAspect();
|
||||
@ -171,7 +171,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
||||
const Aspect_TypeOfMarker aProjTOM,
|
||||
const Aspect_TypeOfLine aCallTOL) const
|
||||
{
|
||||
if (!myDrawer->HasPointAspect()){
|
||||
if (!myDrawer->HasOwnPointAspect()){
|
||||
myDrawer->SetPointAspect(new Prs3d_PointAspect(aProjTOM, aColor,1));}
|
||||
else {
|
||||
const Handle(Prs3d_PointAspect)& pa = myDrawer->PointAspect();
|
||||
@ -182,7 +182,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
||||
// calcul du projete
|
||||
StdPrs_Point::Add(aPrs, new Geom_CartesianPoint(ProjPoint), myDrawer);
|
||||
|
||||
if (!myDrawer->HasWireAspect()){
|
||||
if (!myDrawer->HasOwnWireAspect()){
|
||||
myDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aCallTOL,2.));}
|
||||
else {
|
||||
const Handle(Prs3d_LineAspect)& li = myDrawer->WireAspect();
|
||||
@ -213,16 +213,17 @@ void AIS_Relation::SetColor(const Quantity_Color &aCol)
|
||||
{
|
||||
if(hasOwnColor && myOwnColor==aCol) return;
|
||||
|
||||
if (!myDrawer->HasTextAspect()) myDrawer->SetTextAspect(new Prs3d_TextAspect());
|
||||
if (!myDrawer->HasOwnTextAspect()) myDrawer->SetTextAspect(new Prs3d_TextAspect());
|
||||
hasOwnColor=Standard_True;
|
||||
myOwnColor=aCol;
|
||||
myDrawer->TextAspect()->SetColor(aCol);
|
||||
|
||||
Standard_Real WW = HasWidth()? Width():AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
if (!myDrawer->HasLineAspect()) {
|
||||
Standard_Real WW = HasWidth()? Width(): myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
|
||||
if (!myDrawer->HasOwnLineAspect()) {
|
||||
myDrawer->SetLineAspect(new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
}
|
||||
if (!myDrawer->HasDimensionAspect()) {
|
||||
if (!myDrawer->HasOwnDimensionAspect()) {
|
||||
myDrawer->SetDimensionAspect(new Prs3d_DimensionAspect);
|
||||
}
|
||||
|
||||
@ -244,11 +245,14 @@ void AIS_Relation::UnsetColor()
|
||||
if (!hasOwnColor) return;
|
||||
hasOwnColor = Standard_False;
|
||||
const Handle(Prs3d_LineAspect)& LA = myDrawer->LineAspect();
|
||||
Quantity_Color CC;
|
||||
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
|
||||
}
|
||||
LA->SetColor(CC);
|
||||
myDrawer->DimensionAspect()->SetLineAspect(LA);
|
||||
myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -34,7 +34,7 @@ class Shape from AIS inherits InteractiveObject from AIS
|
||||
-- an inheriting shape class. These services allow you to
|
||||
-- select one type of shape interactive object for higher
|
||||
-- precision drawing. When you do this, the
|
||||
-- AIS_Drawer::IsOwn... functions corresponding to the
|
||||
-- Prs3d_Drawer::IsOwn... functions corresponding to the
|
||||
-- above deviation angle and coefficient functions return
|
||||
-- true indicating that there is a local setting available
|
||||
-- for the specific object.
|
||||
@ -52,7 +52,6 @@ uses
|
||||
Projector from Prs3d,
|
||||
PresentationManager3d from PrsMgr,
|
||||
Selection from SelectMgr,
|
||||
Drawer from AIS,
|
||||
KindOfInteractive from AIS,
|
||||
Transformation from Geom,
|
||||
Drawer from Prs3d,
|
||||
@ -99,7 +98,7 @@ uses
|
||||
---Purpose: Sets a local value for deviation coefficient for this specific shape.
|
||||
|
||||
SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;
|
||||
---Purpose: sets myOwnHLRDeviationCoefficient field in AIS_Drawer &
|
||||
---Purpose: sets myOwnHLRDeviationCoefficient field in Prs3d_Drawer &
|
||||
-- recomputes presentation
|
||||
|
||||
SetAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
|
||||
@ -110,7 +109,7 @@ uses
|
||||
---Purpose: gives back the angle initial value put by the User.
|
||||
|
||||
SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;
|
||||
---Purpose: sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation
|
||||
---Purpose: sets myOwnDeviationAngle field in Prs3d_Drawer & recomputes presentation
|
||||
|
||||
|
||||
SetHLRAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
|
||||
@ -118,7 +117,7 @@ uses
|
||||
-- and set the values stored in myDrawer for with these that become local to the shape
|
||||
|
||||
SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;
|
||||
---Purpose: sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation
|
||||
---Purpose: sets myOwnHLRDeviationAngle field in Prs3d_Drawer & recomputes presentation
|
||||
|
||||
|
||||
OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
|
||||
@ -194,16 +193,16 @@ uses
|
||||
---Purpose: Sets the color aColor in the reconstructed
|
||||
-- compound shape. Acts via the Drawer methods below on the appearance of:
|
||||
-- - free boundaries:
|
||||
-- AIS_Drawer_FreeBoundaryAspect,
|
||||
-- - isos: AIS_Drawer_UIsoAspect,
|
||||
-- AIS_Drawer_VIsoAspect,
|
||||
-- Prs3d_Drawer_FreeBoundaryAspect,
|
||||
-- - isos: Prs3d_Drawer_UIsoAspect,
|
||||
-- Prs3dDrawer_VIsoAspect,
|
||||
-- - shared boundaries:
|
||||
-- AIS_Drawer_UnFreeBoundaryAspect,
|
||||
-- - shading: AIS_Drawer_ShadingAspect,
|
||||
-- Prs3d_Drawer_UnFreeBoundaryAspect,
|
||||
-- - shading: Prs3d_Drawer_ShadingAspect,
|
||||
-- - visible line color in hidden line mode:
|
||||
-- AIS_Drawer_SeenLineAspect
|
||||
-- Prs3d_Drawer_SeenLineAspect
|
||||
-- - hidden line color in hidden line mode:
|
||||
-- AIS_Drawer_HiddenLineAspect.
|
||||
-- Prs3d_Drawer_HiddenLineAspect.
|
||||
|
||||
SetColor(me:mutable;aColor:Color from Quantity)
|
||||
is redefined virtual;
|
||||
@ -283,22 +282,22 @@ uses
|
||||
ashape : Shape from TopoDS) is static private;
|
||||
|
||||
setColor (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theColor : Color from Quantity)
|
||||
is protected;
|
||||
|
||||
setWidth (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theWidth : Real from Standard)
|
||||
is protected;
|
||||
|
||||
setTransparency (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theValue : Real from Standard)
|
||||
is protected;
|
||||
|
||||
setMaterial (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theMaterial : MaterialAspect from Graphic3d;
|
||||
theToKeepColor : Boolean from Standard;
|
||||
theToKeepTransp : Boolean from Standard)
|
||||
|
@ -66,7 +66,6 @@
|
||||
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <HLRBRep.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
@ -94,10 +93,9 @@ static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard
|
||||
AIS_Shape::
|
||||
AIS_Shape(const TopoDS_Shape& shap):
|
||||
AIS_InteractiveObject(PrsMgr_TOP_ProjectorDependant),
|
||||
myshape(shap),
|
||||
myCompBB(Standard_True),
|
||||
myInitAng(0.)
|
||||
{
|
||||
Set (shap);
|
||||
myFirstCompute = Standard_True;
|
||||
SetHilightMode(0);
|
||||
myDrawer->SetShadingAspectGlobal(Standard_False);
|
||||
@ -254,7 +252,7 @@ void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
|
||||
}
|
||||
|
||||
Handle (Prs3d_Drawer) defdrawer = GetContext()->DefaultDrawer();
|
||||
if (defdrawer->DrawHiddenLine())
|
||||
if (defdrawer->DrawHiddenLine())
|
||||
{myDrawer->EnableDrawHiddenLine();}
|
||||
else {myDrawer->DisableDrawHiddenLine();}
|
||||
|
||||
@ -440,28 +438,40 @@ void AIS_Shape::SetColor(const Quantity_NameOfColor aCol)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setColor (const Handle(AIS_Drawer)& theDrawer,
|
||||
const Quantity_Color& theColor) const
|
||||
void AIS_Shape::setColor (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Quantity_Color& theColor) const
|
||||
{
|
||||
if (!theDrawer->HasShadingAspect())
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasLineAspect())
|
||||
if (!theDrawer->HasOwnLineAspect())
|
||||
{
|
||||
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasWireAspect())
|
||||
if (!theDrawer->HasOwnWireAspect())
|
||||
{
|
||||
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasPointAspect())
|
||||
if (!theDrawer->HasOwnPointAspect())
|
||||
{
|
||||
theDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_BLACK, 1.0));
|
||||
*theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
// disable dedicated line aspects
|
||||
theDrawer->SetFreeBoundaryAspect (theDrawer->LineAspect());
|
||||
@ -559,26 +569,53 @@ void AIS_Shape::UnsetColor()
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity_Color aColor;
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, aColor);
|
||||
Quantity_Color aColor = Quantity_NOC_YELLOW;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, aColor);
|
||||
}
|
||||
myDrawer->LineAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Wire, aColor);
|
||||
aColor = Quantity_NOC_RED;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Wire, aColor);
|
||||
}
|
||||
myDrawer->WireAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Free, aColor);
|
||||
aColor = Quantity_NOC_GREEN;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Free, aColor);
|
||||
}
|
||||
myDrawer->FreeBoundaryAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_UnFree, aColor);
|
||||
aColor = Quantity_NOC_YELLOW;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_UnFree, aColor);
|
||||
}
|
||||
myDrawer->UnFreeBoundaryAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Seen, aColor);
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Seen, aColor);
|
||||
}
|
||||
myDrawer->SeenLineAspect()->SetColor (aColor);
|
||||
}
|
||||
|
||||
if (HasMaterial()
|
||||
|| IsTransparent())
|
||||
{
|
||||
Graphic3d_MaterialAspect mat = AIS_GraphicTool::GetMaterial(HasMaterial()? myDrawer : myDrawer->Link());
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect mat = aDefaultMat;
|
||||
if (HasMaterial() || myDrawer->HasLink())
|
||||
{
|
||||
mat = AIS_GraphicTool::GetMaterial(HasMaterial()? myDrawer : myDrawer->Link());
|
||||
}
|
||||
if (HasMaterial())
|
||||
{
|
||||
Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
Quantity_Color aColor = aDefaultMat.AmbientColor();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
}
|
||||
mat.SetColor (aColor);
|
||||
}
|
||||
if (IsTransparent())
|
||||
@ -638,18 +675,24 @@ void AIS_Shape::UnsetColor()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setWidth (const Handle(AIS_Drawer)& theDrawer,
|
||||
const Standard_Real theLineWidth) const
|
||||
void AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Real theLineWidth) const
|
||||
{
|
||||
if (!theDrawer->HasLineAspect())
|
||||
if (!theDrawer->HasOwnLineAspect())
|
||||
{
|
||||
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasWireAspect())
|
||||
if (!theDrawer->HasOwnWireAspect())
|
||||
{
|
||||
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
// disable dedicated line aspects
|
||||
theDrawer->SetFreeBoundaryAspect (theDrawer->LineAspect());
|
||||
@ -701,11 +744,16 @@ void AIS_Shape::UnsetWidth()
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->LineAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line));
|
||||
myDrawer->WireAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Wire));
|
||||
myDrawer->FreeBoundaryAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Free));
|
||||
myDrawer->UnFreeBoundaryAspect()->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_UnFree));
|
||||
myDrawer->SeenLineAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Seen));
|
||||
myDrawer->LineAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.);
|
||||
myDrawer->WireAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Wire) : 1.);
|
||||
myDrawer->FreeBoundaryAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Free) : 1.);
|
||||
myDrawer->UnFreeBoundaryAspect()->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_UnFree) : 1.);
|
||||
myDrawer->SeenLineAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Seen) : 1.);
|
||||
}
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
}
|
||||
@ -715,17 +763,20 @@ void AIS_Shape::UnsetWidth()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setMaterial (const Handle(AIS_Drawer)& theDrawer,
|
||||
void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Graphic3d_MaterialAspect& theMaterial,
|
||||
const Standard_Boolean theToKeepColor,
|
||||
const Standard_Boolean theToKeepTransp) const
|
||||
{
|
||||
const Quantity_Color aColor = theDrawer->ShadingAspect()->Material (myCurrentFacingModel).Color();
|
||||
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
||||
if (!theDrawer->HasShadingAspect())
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
|
||||
|
||||
@ -805,8 +856,11 @@ void AIS_Shape::UnsetMaterial()
|
||||
if (HasColor()
|
||||
|| IsTransparent())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
|
||||
myCurrentFacingModel);
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
|
||||
myCurrentFacingModel);
|
||||
}
|
||||
if (HasColor())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetColor (myOwnColor, myCurrentFacingModel);
|
||||
@ -851,13 +905,16 @@ void AIS_Shape::UnsetMaterial()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setTransparency (const Handle(AIS_Drawer)& theDrawer,
|
||||
const Standard_Real theValue) const
|
||||
void AIS_Shape::setTransparency (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Real theValue) const
|
||||
{
|
||||
if (!theDrawer->HasShadingAspect())
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
// override transparency
|
||||
@ -910,7 +967,7 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
|
||||
void AIS_Shape::UnsetTransparency()
|
||||
{
|
||||
myTransparency = 0.0;
|
||||
if (!myDrawer->HasShadingAspect())
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -996,7 +1053,7 @@ const Bnd_Box& AIS_Shape::BoundingBox()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnDeviationCoefficient();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnDeviationCoefficient();
|
||||
if(itSet) myDrawer->SetDeviationCoefficient();
|
||||
return itSet;
|
||||
}
|
||||
@ -1009,7 +1066,7 @@ Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient ()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationCoefficient();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationCoefficient();
|
||||
if(itSet) myDrawer->SetHLRDeviationCoefficient();
|
||||
return itSet;
|
||||
|
||||
@ -1023,7 +1080,7 @@ Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient ()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnDeviationAngle ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnDeviationAngle();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnDeviationAngle();
|
||||
if(itSet) myDrawer->SetDeviationAngle();
|
||||
return itSet;
|
||||
|
||||
@ -1037,7 +1094,7 @@ Standard_Boolean AIS_Shape::SetOwnDeviationAngle ()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationAngle();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationAngle();
|
||||
if(itSet) myDrawer->SetHLRAngle();
|
||||
return itSet;
|
||||
|
||||
@ -1138,7 +1195,7 @@ Standard_Boolean AIS_Shape::OwnDeviationCoefficient ( Standard_Real & aCoeffici
|
||||
{
|
||||
aCoefficient = myDrawer->DeviationCoefficient();
|
||||
aPreviousCoefficient = myDrawer->PreviousDeviationCoefficient ();
|
||||
return myDrawer->IsOwnDeviationCoefficient() ;
|
||||
return myDrawer->HasOwnDeviationCoefficient() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@ -1151,7 +1208,7 @@ Standard_Boolean AIS_Shape::OwnHLRDeviationCoefficient ( Standard_Real & aCoeffi
|
||||
{
|
||||
aCoefficient = myDrawer->HLRDeviationCoefficient();
|
||||
aPreviousCoefficient = myDrawer->PreviousHLRDeviationCoefficient ();
|
||||
return myDrawer->IsOwnHLRDeviationCoefficient();
|
||||
return myDrawer->HasOwnHLRDeviationCoefficient();
|
||||
|
||||
}
|
||||
|
||||
@ -1165,7 +1222,7 @@ Standard_Boolean AIS_Shape::OwnDeviationAngle ( Standard_Real & anAngle,
|
||||
{
|
||||
anAngle = myDrawer->DeviationAngle();
|
||||
aPreviousAngle = myDrawer->PreviousDeviationAngle ();
|
||||
return myDrawer->IsOwnDeviationAngle();
|
||||
return myDrawer->HasOwnDeviationAngle();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@ -1178,5 +1235,5 @@ Standard_Boolean AIS_Shape::OwnHLRDeviationAngle ( Standard_Real & anAngle,
|
||||
{
|
||||
anAngle = myDrawer->HLRAngle();
|
||||
aPreviousAngle = myDrawer->PreviousHLRDeviationAngle ();
|
||||
return myDrawer->IsOwnHLRDeviationAngle();
|
||||
return myDrawer->HasOwnHLRDeviationAngle();
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
inline void AIS_Shape::Set(const TopoDS_Shape& ashap)
|
||||
{
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include <AIS_SymmetricRelation.ixx>
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <gce_MakeLin.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include <AIS_TexturedShape.hxx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
@ -25,6 +24,7 @@
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
|
@ -11,12 +11,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_Triangulation.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <Poly_Array1OfTriangle.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <TShort_Array1OfShortReal.hxx>
|
||||
|
@ -32,7 +32,7 @@ class Trihedron from AIS inherits InteractiveObject from AIS
|
||||
-- dimensions, you must temporarily recover the Drawer.
|
||||
-- From inside it, you take the aspect in which the values
|
||||
-- for length are stocked. For trihedra, this is
|
||||
-- AIS_Drawer_FirstAxisAspect. You change the
|
||||
-- Prs3d_Drawer_FirstAxisAspect. You change the
|
||||
-- values inside this Aspect and recalculate the presentation.
|
||||
-- If you want to use extended selection modes, different than 0,
|
||||
-- you should take care of removing of the shapes from the interactive
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_Plane.hxx>
|
||||
#include <AIS_Axis.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
@ -118,7 +117,7 @@ void AIS_Trihedron::SetLocalTransformation (const gp_Trsf& theTransformation)
|
||||
void AIS_Trihedron::SetSize(const Standard_Real aValue)
|
||||
{
|
||||
myHasOwnSize = Standard_True;
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
myDrawer->SetDatumAspect(DA);
|
||||
}
|
||||
@ -146,13 +145,16 @@ void AIS_Trihedron::UnsetSize()
|
||||
|
||||
myHasOwnSize = Standard_False;
|
||||
if(hasOwnColor){
|
||||
const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
|
||||
const Handle(Prs3d_DatumAspect) DA =
|
||||
myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() : new Prs3d_DatumAspect();
|
||||
myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
|
||||
DA->SecondAxisLength(),
|
||||
DA->ThirdAxisLength());
|
||||
}
|
||||
else
|
||||
myDrawer->DatumAspect().Nullify();
|
||||
{
|
||||
myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
|
||||
}
|
||||
Update();
|
||||
UpdateSelection();
|
||||
|
||||
@ -165,15 +167,7 @@ void AIS_Trihedron::UnsetSize()
|
||||
|
||||
Standard_Real AIS_Trihedron::Size() const
|
||||
{
|
||||
if(myDrawer->HasDatumAspect()){
|
||||
myDrawer->Link()->DatumAspect(); // ? to ensure that myDrawer->myLink is not null for next call ?
|
||||
return myDrawer->DatumAspect()->FirstAxisLength();
|
||||
}
|
||||
else
|
||||
//return the Defaut value
|
||||
return 100. ;
|
||||
|
||||
|
||||
return myDrawer->DatumAspect()->FirstAxisLength();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@ -363,7 +357,7 @@ void AIS_Trihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelecti
|
||||
{
|
||||
// update AIS_Axis for selection
|
||||
Handle(AIS_Axis) anAxis = Handle(AIS_Axis)::DownCast(myShapes[anIdx]);
|
||||
Handle(AIS_Drawer) aDrawer = anAxis->Attributes();
|
||||
Handle(Prs3d_Drawer) aDrawer = anAxis->Attributes();
|
||||
Handle(Prs3d_DatumAspect) aDatum = myDrawer->DatumAspect();
|
||||
aDrawer->DatumAspect()->SetAxisLength (aDatum->FirstAxisLength(),
|
||||
aDatum->SecondAxisLength(),
|
||||
@ -427,7 +421,7 @@ void AIS_Trihedron::SetColor(const Quantity_Color &aCol)
|
||||
hasOwnColor=Standard_True;
|
||||
myOwnColor = aCol;
|
||||
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
|
||||
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
|
||||
@ -451,7 +445,7 @@ void AIS_Trihedron::SetTextColor(const Quantity_NameOfColor aCol)
|
||||
myHasOwnTextColor = Standard_True;
|
||||
myOwnTextColor = aCol;
|
||||
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
|
||||
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
|
||||
@ -469,7 +463,7 @@ void AIS_Trihedron::SetArrowColor(const Quantity_NameOfColor aCol)
|
||||
myHasOwnArrowColor = Standard_True;
|
||||
myOwnArrowColor = aCol;
|
||||
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
|
||||
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include <ViewerTest.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <ViewerTest.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include <PPrsStd_AISPresentation.hxx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <PCollection_HExtendedString.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#include <PPrsStd_AISPresentation_1.hxx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <PCollection_HExtendedString.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <PCollection_HExtendedString.hxx>
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_TextureParams.hxx>
|
||||
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
@ -56,7 +57,6 @@
|
||||
#include <Graphic3d_TypeOfTextureMode.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Quantity_Array1OfColor.hxx>
|
||||
#include <Aspect_SequenceOfColor.hxx>
|
||||
|
||||
@ -438,12 +438,12 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
||||
|
||||
if ( myUseTexture )
|
||||
{
|
||||
Handle(AIS_Drawer) anAISDrawer = myParentMesh->Attributes();
|
||||
if ( anAISDrawer.IsNull() )
|
||||
Handle(Prs3d_Drawer) aPrsDrawer = myParentMesh->Attributes();
|
||||
if ( aPrsDrawer.IsNull() )
|
||||
return;
|
||||
|
||||
anAISDrawer->SetShadingAspect( new Prs3d_ShadingAspect() );
|
||||
anAsp = anAISDrawer->ShadingAspect()->Aspect();
|
||||
aPrsDrawer->SetShadingAspect( new Prs3d_ShadingAspect() );
|
||||
anAsp = aPrsDrawer->ShadingAspect()->Aspect();
|
||||
if ( anAsp.IsNull() )
|
||||
return;
|
||||
|
||||
|
@ -7,3 +7,5 @@ Prs3d_DimensionUnits.hxx
|
||||
Prs3d_DimensionUnits.cxx
|
||||
Prs3d_PresentationShadow.hxx
|
||||
Prs3d_PresentationShadow.cxx
|
||||
Prs3d_Drawer.hxx
|
||||
Prs3d_Drawer.cxx
|
||||
|
@ -66,8 +66,8 @@ is
|
||||
---Purpose: Declares types of hidden line removal algorithm.
|
||||
-- TOH_Algo enables using of exact HLR algorithm.
|
||||
-- TOH_PolyAlgo enables using of polygonal HLR algorithm.
|
||||
-- TOH_NotSet is used by AIS_Drawer class, it means that the drawer should return the global value.
|
||||
-- For more details see AIS_Drawer class, AIS_Shape::Compute() method and
|
||||
-- TOH_NotSet is used by Prs3d_Drawer class, it means that the drawer should return the global value.
|
||||
-- For more details see Prs3d_Drawer class, AIS_Shape::Compute() method and
|
||||
-- HLRAlgo package from TKHLR toolkit.
|
||||
|
||||
enumeration DimensionTextHorizontalPosition is DTHP_Left, DTHP_Right, DTHP_Center, DTHP_Fit;
|
||||
@ -114,7 +114,7 @@ is
|
||||
class DatumAspect;
|
||||
imported DimensionUnits;
|
||||
|
||||
class Drawer;
|
||||
imported transient class Drawer;
|
||||
|
||||
class Projector;
|
||||
|
||||
|
@ -1,601 +0,0 @@
|
||||
-- Created on: 1992-09-18
|
||||
-- Created by: Jean Louis FRENKEL
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Drawer from Prs3d inherits TShared from MMgt
|
||||
|
||||
---Purpose: A graphic attribute manager which governs how
|
||||
-- objects such as color, width, line thickness and
|
||||
-- deflection are displayed.
|
||||
-- Prs3d_Drawer is the mother class of AIS_Drawer.
|
||||
-- As such, it is its set functions which are called to
|
||||
-- modify display parameters. In the example below we
|
||||
-- can see that the AIS_Drawer is modified to set the
|
||||
-- value of the deviation coefficient using a method
|
||||
-- inherited from Prs3d_Drawer.
|
||||
-- A drawer includes an instance of the Aspect classes
|
||||
-- with particular default values.
|
||||
|
||||
uses
|
||||
DatumAspect from Prs3d,
|
||||
LineAspect from Prs3d,
|
||||
TextAspect from Prs3d,
|
||||
PointAspect from Prs3d,
|
||||
ShadingAspect from Prs3d,
|
||||
IsoAspect from Prs3d,
|
||||
DimensionAspect from Prs3d,
|
||||
PlaneAspect from Prs3d,
|
||||
ArrowAspect from Prs3d,
|
||||
TypeOfDeflection from Aspect,
|
||||
NameOfColor from Quantity,
|
||||
PlaneAngle from Quantity,
|
||||
Length from Quantity,
|
||||
TypeOfHLR from Prs3d,
|
||||
DimensionUnits from Prs3d,
|
||||
VertexDrawMode from Prs3d,
|
||||
AsciiString from TCollection,
|
||||
Ax2 from gp
|
||||
|
||||
is
|
||||
Create returns Drawer from Prs3d;
|
||||
|
||||
---Category: deviation definition.
|
||||
--
|
||||
-- All drawings of curves or patches are made with respect to a maximal
|
||||
-- chordial deviation. This deviation is absolute and given through
|
||||
-- the method: SetMaximalChordialDeviation.
|
||||
--
|
||||
-- In the case of drawing shapes, it is allowed to ask for a relative
|
||||
-- deviation.
|
||||
-- This deviation will be: SizeOfObject * DeviationCoefficient where
|
||||
-- DeviationCoefficient can be set through the method: SetDeviationCoefficient.
|
||||
--
|
||||
--
|
||||
-- For drawing algorithms using discretisation, a default number of
|
||||
-- points has been set to 17. It is possible to use the method SetDiscret
|
||||
-- to change this number.
|
||||
--
|
||||
|
||||
|
||||
SetTypeOfDeflection (me:mutable;
|
||||
aTypeOfDeflection: TypeOfDeflection from Aspect)
|
||||
---Purpose: Sets the type of chordal deflection.
|
||||
-- This indicates whether the deflection value is absolute
|
||||
-- or relative to the size of the object.
|
||||
is virtual;
|
||||
|
||||
TypeOfDeflection(me) returns TypeOfDeflection from Aspect
|
||||
is virtual;
|
||||
--- Purpose: Returns the type of chordal deflection.
|
||||
-- This indicates whether the deflection value is absolute
|
||||
-- or relative to the size of the object.
|
||||
|
||||
SetMaximalChordialDeviation (me: mutable;
|
||||
aChordialDeviation: Length from Quantity)
|
||||
---Purpose: Defines the maximal chordial deviation when drawing any curve;
|
||||
-- Even if the type of deviation is set to TOD_Relative,
|
||||
-- this value is used by:
|
||||
--
|
||||
-- Prs3d_DeflectionCurve
|
||||
-- Prs3d_WFDeflectionSurface
|
||||
-- Prs3d_WFDeflectionRestrictedFace
|
||||
is virtual;
|
||||
|
||||
MaximalChordialDeviation (me) returns Length from Quantity
|
||||
---Purpose: returns the maximal chordial deviation. Default value is 0.1
|
||||
is virtual;
|
||||
|
||||
SetDeviationCoefficient(me: mutable; aCoefficient: Real from Standard)
|
||||
---Purpose: Sets the deviation coefficient aCoefficient.
|
||||
is virtual;
|
||||
|
||||
DeviationCoefficient(me) returns Real from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns the deviation coefficient.
|
||||
SetHLRDeviationCoefficient(me: mutable; aCoefficient: Real from Standard)
|
||||
---Purpose: Sets the deviation coefficient aCoefficient for removal
|
||||
-- of hidden lines created by different viewpoints in
|
||||
-- different presentations. The Default value is 0.02.
|
||||
is virtual;
|
||||
|
||||
HLRDeviationCoefficient(me) returns Real from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns the real number value of the hidden line
|
||||
-- removal deviation coefficient.
|
||||
SetHLRAngle(me: mutable; anAngle: Real from Standard)
|
||||
---Purpose: Sets anAngle, the angle of maximum chordal
|
||||
-- deviation for removal of hidden lines created by
|
||||
-- different viewpoints in different presentations. The
|
||||
-- default value is 20*PI/180.
|
||||
is virtual;
|
||||
|
||||
HLRAngle(me) returns Real from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns the real number value of the deviation angle
|
||||
-- in hidden line removal views. The default value is 20*PI/180.
|
||||
|
||||
SetDeviationAngle(me: mutable; anAngle: Real from Standard)
|
||||
---Purpose: Sets deviation angle
|
||||
is virtual;
|
||||
|
||||
DeviationAngle(me) returns Real from Standard
|
||||
---Purpose: Returns the value for deviation angle.
|
||||
is virtual;
|
||||
|
||||
SetDiscretisation(me: mutable; d: Integer from Standard)
|
||||
---Purpose: Sets the discretisation parameter d.
|
||||
is virtual;
|
||||
|
||||
Discretisation(me) returns Integer from Standard
|
||||
is virtual;
|
||||
---Purpose: Returns the discretisation setting.
|
||||
SetMaximalParameterValue(me: mutable; Value: Real from Standard)
|
||||
---Purpose: defines the maximum value allowed for the first and last
|
||||
-- parameters of an infinite curve. Default value: 500.
|
||||
is virtual;
|
||||
|
||||
MaximalParameterValue(me) returns Real from Standard
|
||||
is virtual;
|
||||
--- Purpose: Sets the maximum value allowed for the first and last
|
||||
-- parameters of an infinite curve. By default, this value is 500000.
|
||||
|
||||
SetIsoOnPlane (me: mutable; OnOff: Boolean from Standard)
|
||||
---Purpose: Sets IsoOnPlane on or off by setting the parameter
|
||||
-- OnOff to true or false.
|
||||
is virtual;
|
||||
|
||||
IsoOnPlane(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if the drawing of isos on planes is enabled.
|
||||
is virtual;
|
||||
|
||||
SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets the type of HLR algorithm
|
||||
-- used by drawer's interactive objects
|
||||
|
||||
TypeOfHLR(me) returns TypeOfHLR from Prs3d
|
||||
is virtual;
|
||||
---Purpose: Gets the myTypeOfHLR value
|
||||
|
||||
|
||||
--
|
||||
-- Attributes for the U Isoparametric lines of patches.
|
||||
--
|
||||
UIsoAspect (me:mutable) returns IsoAspect from Prs3d
|
||||
---Purpose: Defines the attributes which are used when drawing an
|
||||
-- U isoparametric curve of a face. Defines the number
|
||||
-- of U isoparametric curves to be drawn for a single face.
|
||||
-- The LineAspect for U isoparametric lines can be edited
|
||||
-- (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
-- The default values are:
|
||||
-- COLOR : Quantity_NOC_GRAY75
|
||||
-- TYPE OF LINE: Aspect_TOL_SOLID
|
||||
-- WIDTH : 0.5
|
||||
--
|
||||
--
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFDeflectionSurface
|
||||
-- Prs3d_WFDeflectionRestrictedFace
|
||||
|
||||
|
||||
is virtual;
|
||||
|
||||
SetUIsoAspect (me:mutable; anAspect: IsoAspect from Prs3d)
|
||||
is virtual;
|
||||
|
||||
-- Attributes for the V Isoparametric line of patches.
|
||||
|
||||
|
||||
VIsoAspect (me:mutable) returns IsoAspect from Prs3d
|
||||
---Purpose: Defines the attributes which are used when drawing an
|
||||
-- V isoparametric curve of a face. Defines the number
|
||||
-- of V isoparametric curves to be drawn for a single face.
|
||||
-- The LineAspect for V isoparametric lines can be edited
|
||||
-- (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
-- The default values are:
|
||||
-- COLOR : Quantity_NOC_GRAY82
|
||||
-- TYPE OF LINE: Aspect_TOL_SOLID
|
||||
-- WIDTH : 0.5
|
||||
--
|
||||
--
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFDeflectionSurface
|
||||
-- Prs3d_WFDeflectionRestrictedFace
|
||||
is virtual;
|
||||
|
||||
SetVIsoAspect (me:mutable;anAspect: IsoAspect from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets the appearance of V isoparameters - anAspect.
|
||||
|
||||
FreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Stores the values for presentation of free boundaries,
|
||||
-- in other words, boundaries which are not shared.
|
||||
-- The LineAspect for the free boundaries can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_GREEN
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the algorithm Prs3d_WFShape
|
||||
is virtual;
|
||||
|
||||
SetFreeBoundaryAspect(me:mutable;anAspect: LineAspect from Prs3d)
|
||||
is virtual;
|
||||
--- Purpose: Sets the parameter anAspect for the display of free boundaries.
|
||||
|
||||
SetFreeBoundaryDraw (me: mutable; OnOff: Boolean from Standard)
|
||||
---Purpose: Sets free boundary drawing on or off by setting the
|
||||
-- parameter OnOff to true or false.
|
||||
|
||||
is virtual;
|
||||
|
||||
FreeBoundaryDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if the drawing of the shared boundaries
|
||||
-- is disabled. True is the default setting.
|
||||
is virtual;
|
||||
|
||||
|
||||
-- Attributes for the wires
|
||||
|
||||
WireAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns wire aspect settings.
|
||||
-- The LineAspect for the wire can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_RED
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the algorithm Prs3d_WFShape
|
||||
is virtual;
|
||||
|
||||
SetWireAspect(me:mutable;anAspect: LineAspect from Prs3d)
|
||||
is virtual;
|
||||
|
||||
--- Purpose: Sets the parameter anAspect for display of wires.
|
||||
|
||||
SetWireDraw (me: mutable; OnOff: Boolean from Standard)
|
||||
---Purpose: Sets WireDraw on or off by setting the parameter
|
||||
-- OnOff to true or false.
|
||||
|
||||
is virtual;
|
||||
|
||||
WireDraw(me) returns Boolean from Standard
|
||||
---Purpose: returns True if the drawing of the wire is enabled.
|
||||
is virtual;
|
||||
|
||||
|
||||
-- Attributes for the unfree boundaries
|
||||
|
||||
UnFreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns settings for shared boundary line aspects.
|
||||
-- The LineAspect for the unfree boundaries can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the algorithm Prs3d_WFShape
|
||||
is virtual;
|
||||
|
||||
SetUnFreeBoundaryAspect(me:mutable; anAspect: LineAspect from Prs3d)
|
||||
is virtual;
|
||||
--- Purpose: Sets the parameter anAspect for the display of shared boundaries.
|
||||
SetUnFreeBoundaryDraw (me: mutable; OnOff: Boolean from Standard)
|
||||
---Purpose: Sets FreeBoundaryDraw on or off by setting the
|
||||
-- parameter OnOff to true or false.
|
||||
-- By default the unfree boundaries are drawn.
|
||||
|
||||
is virtual;
|
||||
|
||||
UnFreeBoundaryDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if the drawing of the shared boundaries is enabled.
|
||||
-- True is the default setting.
|
||||
is virtual;
|
||||
|
||||
|
||||
--
|
||||
-- Attributes for the lines.
|
||||
--
|
||||
|
||||
LineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns settings for line aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_Curve
|
||||
-- Prs3d_Line
|
||||
-- Prs3d_HLRShape
|
||||
|
||||
is virtual;
|
||||
|
||||
SetLineAspect(me:mutable; anAspect: LineAspect from Prs3d)
|
||||
is virtual;
|
||||
--- Purpose: Sets the parameter anAspect for display attributes of lines.
|
||||
|
||||
TextAspect(me:mutable) returns TextAspect from Prs3d
|
||||
--- Purpose: Returns settings for text aspect.
|
||||
-- These settings can be edited. The default value is:
|
||||
-- - Color: Quantity_NOC_YELLOW
|
||||
|
||||
is virtual;
|
||||
|
||||
SetTextAspect(me:mutable; anAspect: TextAspect from Prs3d)
|
||||
is virtual;
|
||||
--- Purpose: Sets the parameter anAspect for display attributes of text.
|
||||
|
||||
SetLineArrowDraw (me: mutable; OnOff: Boolean from Standard)
|
||||
---Purpose: enables the drawing of an arrow at the end of each line.
|
||||
-- By default the arrows are not drawn.
|
||||
|
||||
is virtual;
|
||||
|
||||
LineArrowDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if drawing an arrow at the end of each edge is enabled
|
||||
-- and False otherwise (the default).
|
||||
is virtual;
|
||||
|
||||
ArrowAspect(me:mutable) returns ArrowAspect from Prs3d
|
||||
is virtual;
|
||||
---Purpose: Returns the attributes for display of arrows.
|
||||
|
||||
SetArrowAspect(me:mutable; anAspect: ArrowAspect from Prs3d)
|
||||
is virtual ;
|
||||
---Purpose: Sets the parameter anAspect for display attributes of arrows.
|
||||
|
||||
PointAspect(me:mutable) returns PointAspect from Prs3d
|
||||
---Purpose: Returns the point aspect setting. The default values are
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of marker: Aspect_TOM_PLUS
|
||||
-- Scale: 1.
|
||||
-- These attributes are used by the algorithms Prs3d_Point.
|
||||
is virtual;
|
||||
|
||||
SetPointAspect(me:mutable; anAspect: PointAspect from Prs3d)
|
||||
is virtual;
|
||||
--- Purpose: Sets the parameter anAspect for display attributes of points
|
||||
|
||||
SetVertexDrawMode(me: mutable; theMode: VertexDrawMode from Prs3d)
|
||||
---Purpose: Sets the mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
-- By default, only stand-alone vertices (not belonging topologically to an edge) are drawn,
|
||||
-- that corresponds to <b>Prs3d_VDM_Standalone</b> mode.
|
||||
-- Switching to <b>Prs3d_VDM_Standalone</b> mode makes all shape's vertices visible.
|
||||
-- To inherit this parameter from the global drawer instance ("the link") when it is present,
|
||||
-- <b>Prs3d_VDM_Inherited</b> value should be used.
|
||||
is virtual;
|
||||
|
||||
VertexDrawMode(me) returns VertexDrawMode from Prs3d
|
||||
---Purpose: Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
is virtual;
|
||||
|
||||
ShadingAspect (me:mutable) returns ShadingAspect from Prs3d
|
||||
is virtual;
|
||||
---Purpose: Returns settings for shading aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- - Color: Quantity_NOC_YELLOW
|
||||
-- - Material: Graphic3d_NOM_BRASS
|
||||
-- Shading aspect is obtained through decomposition of
|
||||
-- 3d faces into triangles, each side of each triangle
|
||||
-- being a chord of the corresponding curved edge in
|
||||
-- the face. Reflection of light in each projector
|
||||
-- perspective is then calculated for each of the
|
||||
-- resultant triangular planes.
|
||||
|
||||
|
||||
SetShadingAspect(me:mutable; anAspect: ShadingAspect from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets the parameter anAspect for display attributes of shading.
|
||||
|
||||
SetShadingAspectGlobal(me: mutable; aValue: Boolean from Standard)
|
||||
---Purpose: indicates that the ShadingAspect will be apply
|
||||
-- to the whole presentation. This allows to modify
|
||||
-- the aspect without recomputing the content of the presentation.
|
||||
is virtual;
|
||||
|
||||
ShadingAspectGlobal(me) returns Boolean from Standard
|
||||
is virtual;
|
||||
--
|
||||
-- Attributes for hidden lines removal. These attributes are used when
|
||||
-- using an algorithm such Prs3d_HLRShape for example.
|
||||
--
|
||||
|
||||
DrawHiddenLine(me) returns Boolean from Standard
|
||||
---Purpose: returns Standard_True if the hidden lines are to be drawn.
|
||||
-- By default the hidden lines are not drawn.
|
||||
is virtual;
|
||||
|
||||
EnableDrawHiddenLine(me: mutable)
|
||||
---Purpose: Enables the DrawHiddenLine function.
|
||||
is virtual;
|
||||
|
||||
DisableDrawHiddenLine(me: mutable)
|
||||
---Purpose: Disables the DrawHiddenLine function.
|
||||
is virtual;
|
||||
|
||||
HiddenLineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns settings for hidden line aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_DASH
|
||||
-- Width: 1.
|
||||
is virtual;
|
||||
|
||||
SetHiddenLineAspect(me:mutable; anAspect: LineAspect from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets the parameter anAspect for the display of
|
||||
-- hidden lines in hidden line removal mode.
|
||||
|
||||
SeenLineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns settings for seen line aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
is virtual;
|
||||
|
||||
SetSeenLineAspect(me:mutable; anAspect: LineAspect from Prs3d)
|
||||
is virtual;
|
||||
--- Purpose: Sets the parameter anAspect for the display of seen
|
||||
-- lines in hidden line removal mode.
|
||||
|
||||
PlaneAspect(me:mutable) returns PlaneAspect from Prs3d
|
||||
is virtual;
|
||||
---Purpose: Returns settings for the appearance of planes.
|
||||
|
||||
SetPlaneAspect(me:mutable; anAspect: PlaneAspect from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets the parameter anAspect for the display of planes.
|
||||
|
||||
VectorAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns settings for the appearance of vectors.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_SKYBLUE
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
is virtual;
|
||||
|
||||
SetVectorAspect(me:mutable; anAspect: LineAspect from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets the modality anAspect for the display of vectors.
|
||||
|
||||
--
|
||||
-- Attributes for the presentation of a Datum.
|
||||
--
|
||||
|
||||
DatumAspect(me:mutable) returns DatumAspect from Prs3d
|
||||
---Purpose: Returns settings for the appearance of datums.
|
||||
-- These settings can be edited. The default values for
|
||||
-- the three axes are:
|
||||
-- Color: Quantity_NOC_PEACHPUFF
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
is virtual;
|
||||
|
||||
SetDatumAspect(me:mutable; anAspect: DatumAspect from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets the modality anAspect for the display of datums.
|
||||
|
||||
DimensionAspect(me:mutable) returns DimensionAspect from Prs3d is virtual;
|
||||
---Purpose: Returns settings for the appearance of dimensions.
|
||||
|
||||
SetDimensionAspect(me:mutable; theAspect: DimensionAspect from Prs3d) is virtual;
|
||||
---Purpose: Sets the settings for the appearance of dimensions.
|
||||
|
||||
SetDimLengthModelUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
|
||||
---Purpose: Sets dimension length model units for computing of dimension presentation.
|
||||
|
||||
SetDimAngleModelUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
|
||||
---Purpose: Sets dimension angle model units for computing of dimension presentation.
|
||||
|
||||
DimLengthModelUnits (me) returns AsciiString from TCollection is virtual;
|
||||
---Purpose: Returns length model units for the dimension presentation.
|
||||
---C++: return const &
|
||||
|
||||
DimAngleModelUnits (me) returns AsciiString from TCollection is virtual;
|
||||
---Purpose: Returns angle model units for the dimension presentation.
|
||||
---C++: return const &
|
||||
|
||||
SetDimLengthDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
|
||||
---Purpose: Sets length units in which value for dimension presentation is displayed.
|
||||
|
||||
SetDimAngleDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is virtual;
|
||||
---Purpose: Sets angle units in which value for dimension presentation is displayed.
|
||||
|
||||
DimLengthDisplayUnits (me) returns AsciiString from TCollection is virtual;
|
||||
---Purpose: Returns length units in which dimension presentation is displayed.
|
||||
---C++: return const &
|
||||
|
||||
DimAngleDisplayUnits (me) returns AsciiString from TCollection is virtual;
|
||||
---Purpose: Returns angle units in which dimension presentation is displayed.
|
||||
---C++: return const &
|
||||
|
||||
SectionAspect (me : mutable) returns LineAspect from Prs3d is virtual;
|
||||
---Purpose: The LineAspect for the wire can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_ORANGE
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the algorithm Prs3d_WFShape.
|
||||
|
||||
SetSectionAspect (me : mutable; theAspect: LineAspect from Prs3d) is virtual;
|
||||
---Purpose: Sets the parameter theAspect for display attributes of sections.
|
||||
|
||||
SetFaceBoundaryDraw (me : mutable;
|
||||
theIsEnabled : Boolean from Standard)
|
||||
is virtual;
|
||||
---Purpose: Enables or disables face boundary drawing for shading presentations.
|
||||
-- theIsEnabled is a boolean flag indicating whether the face boundaries should be
|
||||
-- drawn or not.
|
||||
|
||||
IsFaceBoundaryDraw (me) returns Boolean from Standard
|
||||
is virtual;
|
||||
---Purpose: Checks whether the face boundary drawing is enabled or not.
|
||||
|
||||
SetFaceBoundaryAspect (me : mutable;
|
||||
theAspect : LineAspect from Prs3d)
|
||||
is virtual;
|
||||
---Purpose: Sets line aspect for face boundaries.
|
||||
-- theAspect is the line aspect that determines the look of the face boundaries.
|
||||
|
||||
FaceBoundaryAspect (me : mutable) returns LineAspect from Prs3d
|
||||
is virtual;
|
||||
---Purpose: Returns line aspect of face boundaries.
|
||||
|
||||
fields
|
||||
|
||||
myUIsoAspect: IsoAspect from Prs3d is protected;
|
||||
myVIsoAspect: IsoAspect from Prs3d is protected;
|
||||
myNbPoints : Integer from Standard is protected;
|
||||
myIsoOnPlane: Boolean from Standard is protected;
|
||||
myFreeBoundaryAspect: LineAspect from Prs3d is protected;
|
||||
myFreeBoundaryDraw: Boolean from Standard is protected;
|
||||
myUnFreeBoundaryAspect: LineAspect from Prs3d is protected;
|
||||
myUnFreeBoundaryDraw: Boolean from Standard is protected;
|
||||
myWireAspect: LineAspect from Prs3d is protected;
|
||||
myWireDraw: Boolean from Standard is protected;
|
||||
myLineAspect: LineAspect from Prs3d is protected;
|
||||
myTextAspect: TextAspect from Prs3d is protected;
|
||||
myShadingAspect: ShadingAspect from Prs3d is protected;
|
||||
myShadingAspectGlobal: Boolean from Standard is protected;
|
||||
myChordialDeviation: Length from Quantity is protected;
|
||||
myTypeOfDeflection: TypeOfDeflection from Aspect is protected;
|
||||
myMaximalParameterValue: Real from Standard is protected;
|
||||
|
||||
myDeviationCoefficient: Real from Standard is protected;
|
||||
myHLRDeviationCoefficient: Real from Standard is protected;
|
||||
|
||||
myDeviationAngle: Real from Standard is protected;
|
||||
myHLRAngle: Real from Standard is protected;
|
||||
|
||||
myPointAspect: PointAspect from Prs3d is protected;
|
||||
myVertexDrawMode: VertexDrawMode from Prs3d is protected;
|
||||
myPlaneAspect: PlaneAspect from Prs3d is protected;
|
||||
myArrowAspect: ArrowAspect from Prs3d is protected;
|
||||
myLineDrawArrow: Boolean from Standard is protected;
|
||||
myDrawHiddenLine: Boolean from Standard is protected;
|
||||
myHiddenLineAspect: LineAspect from Prs3d is protected;
|
||||
mySeenLineAspect: LineAspect from Prs3d is protected;
|
||||
myVectorAspect: LineAspect from Prs3d is protected;
|
||||
myDatumAspect: DatumAspect from Prs3d is protected;
|
||||
myDatumScale: Real from Standard is protected;
|
||||
|
||||
myDimensionAspect : DimensionAspect from Prs3d is protected;
|
||||
myDimensionModelUnits : DimensionUnits from Prs3d is protected;
|
||||
myDimensionDisplayUnits : DimensionUnits from Prs3d is protected;
|
||||
|
||||
mySectionAspect : LineAspect from Prs3d is protected;
|
||||
myFaceBoundaryDraw : Boolean from Standard is protected;
|
||||
myFaceBoundaryAspect : LineAspect from Prs3d is protected;
|
||||
myTypeOfHLR : TypeOfHLR from Prs3d is protected;
|
||||
|
||||
end Drawer;
|
File diff suppressed because it is too large
Load Diff
910
src/Prs3d/Prs3d_Drawer.hxx
Normal file
910
src/Prs3d/Prs3d_Drawer.hxx
Normal file
@ -0,0 +1,910 @@
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Prs3d_Drawer_HeaderFile
|
||||
#define _Prs3d_Drawer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
|
||||
#include <Handle_Prs3d_IsoAspect.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Handle_Prs3d_LineAspect.hxx>
|
||||
#include <Handle_Prs3d_TextAspect.hxx>
|
||||
#include <Handle_Prs3d_ShadingAspect.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
#include <Aspect_TypeOfDeflection.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Handle_Prs3d_PointAspect.hxx>
|
||||
#include <Prs3d_VertexDrawMode.hxx>
|
||||
#include <Handle_Prs3d_PlaneAspect.hxx>
|
||||
#include <Handle_Prs3d_ArrowAspect.hxx>
|
||||
#include <Handle_Prs3d_DatumAspect.hxx>
|
||||
#include <Handle_Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_DimensionUnits.hxx>
|
||||
#include <Prs3d_TypeOfHLR.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
|
||||
class Prs3d_IsoAspect;
|
||||
class Prs3d_LineAspect;
|
||||
class Prs3d_TextAspect;
|
||||
class Prs3d_ShadingAspect;
|
||||
class Prs3d_PointAspect;
|
||||
class Prs3d_PlaneAspect;
|
||||
class Prs3d_ArrowAspect;
|
||||
class Prs3d_DatumAspect;
|
||||
class Prs3d_DimensionAspect;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Prs3d_Drawer, MMgt_TShared)
|
||||
|
||||
//! A graphic attribute manager which governs how
|
||||
//! objects such as color, width, line thickness and deflection are displayed.
|
||||
//! A drawer includes an instance of the Aspect classes with particular default values.
|
||||
class Prs3d_Drawer : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Default constructor.
|
||||
Standard_EXPORT Prs3d_Drawer();
|
||||
|
||||
//! Sets the type of chordal deflection.
|
||||
//! This indicates whether the deflection value is absolute or relative to the size of the object.
|
||||
Standard_EXPORT void SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection);
|
||||
|
||||
//! Returns the type of chordal deflection.
|
||||
//! This indicates whether the deflection value is absolute or relative to the size of the object.
|
||||
Aspect_TypeOfDeflection TypeOfDeflection() const
|
||||
{
|
||||
return HasOwnTypeOfDeflection() || myLink.IsNull()
|
||||
? myTypeOfDeflection
|
||||
: myLink->TypeOfDeflection();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has a type of deflection setting active.
|
||||
Standard_Boolean HasOwnTypeOfDeflection() const { return myHasOwnTypeOfDeflection; }
|
||||
|
||||
//! Defines the maximal chordial deviation when drawing any curve.
|
||||
//! Even if the type of deviation is set to TOD_Relative, this value is used by:
|
||||
//! Prs3d_DeflectionCurve
|
||||
//! Prs3d_WFDeflectionSurface
|
||||
//! Prs3d_WFDeflectionRestrictedFace
|
||||
Standard_EXPORT void SetMaximalChordialDeviation (const Quantity_Length theChordialDeviation);
|
||||
|
||||
//! Returns the maximal chordal deviation. The default value is 0.1.
|
||||
//! Drawings of curves or patches are made with respect to an absolute maximal chordal deviation.
|
||||
Quantity_Length MaximalChordialDeviation() const
|
||||
{
|
||||
return HasOwnMaximalChordialDeviation() || myLink.IsNull()
|
||||
? myChordialDeviation
|
||||
: myLink->MaximalChordialDeviation();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has a maximal chordial deviation setting active.
|
||||
Standard_Boolean HasOwnMaximalChordialDeviation() const { return myHasOwnChordialDeviation; }
|
||||
|
||||
//! Sets the type of HLR algorithm used by drawer's interactive objects
|
||||
Standard_EXPORT void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR);
|
||||
|
||||
//! Returns the type of HLR algorithm currently in use.
|
||||
Standard_EXPORT Prs3d_TypeOfHLR TypeOfHLR();
|
||||
|
||||
//! Returns true if the type of HLR is not equal to Prs3d_TOH_NotSet.
|
||||
Standard_Boolean HasOwnTypeOfHLR() const { return (myTypeOfHLR != Prs3d_TOH_NotSet); }
|
||||
|
||||
//! Defines the maximum value allowed for the first and last
|
||||
//! parameters of an infinite curve.
|
||||
Standard_EXPORT void SetMaximalParameterValue (const Standard_Real theValue);
|
||||
|
||||
//! Sets the maximum value allowed for the first and last
|
||||
//! parameters of an infinite curve. By default, this value is 500000.
|
||||
Standard_Real MaximalParameterValue() const
|
||||
{
|
||||
return HasOwnMaximalParameterValue() || myLink.IsNull()
|
||||
? myMaximalParameterValue
|
||||
: myLink->MaximalParameterValue();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has a maximum value allowed for the first and last
|
||||
//! parameters of an infinite curve setting active.
|
||||
Standard_Boolean HasOwnMaximalParameterValue() const { return myHasOwnMaximalParameterValue; }
|
||||
|
||||
//! Sets IsoOnPlane on or off by setting the parameter theIsEnabled to true or false.
|
||||
Standard_EXPORT void SetIsoOnPlane (const Standard_Boolean theIsEnabled);
|
||||
|
||||
//! Returns True if the drawing of isos on planes is enabled.
|
||||
Standard_Boolean IsoOnPlane() const
|
||||
{
|
||||
return HasOwnIsoOnPlane() || myLink.IsNull()
|
||||
? myIsoOnPlane
|
||||
: myLink->IsoOnPlane();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has IsoOnPlane setting active.
|
||||
Standard_Boolean HasOwnIsoOnPlane() const { return myHasOwnIsoOnPlane; }
|
||||
|
||||
//! Sets the discretisation parameter theValue.
|
||||
Standard_EXPORT void SetDiscretisation (const Standard_Integer theValue);
|
||||
|
||||
//! Returns the discretisation setting.
|
||||
Standard_Integer Discretisation() const
|
||||
{
|
||||
return HasOwnDiscretisation() || myLink.IsNull()
|
||||
? myNbPoints
|
||||
: myLink->Discretisation();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has discretisation setting active.
|
||||
Standard_Boolean HasOwnDiscretisation() const { return myHasOwnNbPoints; }
|
||||
|
||||
//! Sets the deviation coefficient theCoefficient.
|
||||
//! Also sets the hasOwnDeviationCoefficient flag to Standard_True and myPreviousDeviationCoefficient
|
||||
Standard_EXPORT void SetDeviationCoefficient (const Standard_Real theCoefficient);
|
||||
|
||||
//! Returns the deviation coefficient.
|
||||
//! Drawings of curves or patches are made with respect
|
||||
//! to a maximal chordal deviation. A Deviation coefficient
|
||||
//! is used in the shading display mode. The shape is
|
||||
//! seen decomposed into triangles. These are used to
|
||||
//! calculate reflection of light from the surface of the
|
||||
//! object. The triangles are formed from chords of the
|
||||
//! curves in the shape. The deviation coefficient gives
|
||||
//! the highest value of the angle with which a chord can
|
||||
//! deviate from a tangent to a curve. If this limit is
|
||||
//! reached, a new triangle is begun.
|
||||
//! This deviation is absolute and is set through the
|
||||
//! method: SetMaximalChordialDeviation. The default value is 0.001.
|
||||
//! In drawing shapes, however, you are allowed to ask
|
||||
//! for a relative deviation. This deviation will be:
|
||||
//! SizeOfObject * DeviationCoefficient.
|
||||
Standard_Real DeviationCoefficient() const
|
||||
{
|
||||
return HasOwnDeviationCoefficient() || myLink.IsNull()
|
||||
? myDeviationCoefficient
|
||||
: myLink->DeviationCoefficient();
|
||||
}
|
||||
|
||||
//! Sets the hasOwnDeviationCoefficient flag to Standard_False
|
||||
void SetDeviationCoefficient()
|
||||
{
|
||||
myHasOwnDeviationCoefficient = Standard_False;
|
||||
}
|
||||
|
||||
//! Returns true if there is a local setting for deviation
|
||||
//! coefficient in this framework for a specific interactive object.
|
||||
Standard_Boolean HasOwnDeviationCoefficient() const { return myHasOwnDeviationCoefficient; }
|
||||
|
||||
//! Saves the previous value used for the chordal
|
||||
//! deviation coefficient.
|
||||
Standard_Real PreviousDeviationCoefficient() const
|
||||
{
|
||||
return myHasOwnDeviationCoefficient
|
||||
? myPreviousDeviationCoefficient
|
||||
: 0.0;
|
||||
}
|
||||
|
||||
//! Sets the deviation coefficient aCoefficient for removal
|
||||
//! of hidden lines created by different viewpoints in
|
||||
//! different presentations. The Default value is 0.02.
|
||||
//! Also sets the hasOwnHLRDeviationCoefficient flag to Standard_True and myPreviousHLRDeviationCoefficient
|
||||
Standard_EXPORT void SetHLRDeviationCoefficient (const Standard_Real theCoefficient);
|
||||
|
||||
//! Returns the real number value of the hidden line
|
||||
//! removal deviation coefficient in this framework, if the flag
|
||||
//! hasOwnHLRDeviationCoefficient is true or there is no Link.
|
||||
//! Else the shape's HLR deviation coefficient is used.
|
||||
//! A Deviation coefficient is used in the shading display
|
||||
//! mode. The shape is seen decomposed into triangles.
|
||||
//! These are used to calculate reflection of light from the
|
||||
//! surface of the object.
|
||||
//! The triangles are formed from chords of the curves in
|
||||
//! the shape. The deviation coefficient give the highest
|
||||
//! value of the angle with which a chord can deviate
|
||||
//! from a tangent to a curve. If this limit is reached, a new triangle is begun.
|
||||
//! To find the hidden lines, hidden line display mode
|
||||
//! entails recalculation of the view at each different projector perspective.
|
||||
//! Since hidden lines entail calculations of more than
|
||||
//! usual complexity to decompose them into these
|
||||
//! triangles, a deviation coefficient allowing greater
|
||||
//! tolerance is used. This increases efficiency in calculation.
|
||||
//! The Default value is 0.02.
|
||||
Standard_Real HLRDeviationCoefficient() const
|
||||
{
|
||||
return HasOwnHLRDeviationCoefficient() || myLink.IsNull()
|
||||
? myHLRDeviationCoefficient
|
||||
: myLink->HLRDeviationCoefficient();
|
||||
}
|
||||
|
||||
//! Sets the hasOwnHLRDeviationCoefficient flag to Standard_False
|
||||
void SetHLRDeviationCoefficient()
|
||||
{
|
||||
myHasOwnHLRDeviationCoefficient = Standard_False;
|
||||
}
|
||||
|
||||
//! Returns true if the there is a setting for HLR deviation
|
||||
//! coefficient in this framework for a specific interactive object.
|
||||
Standard_Boolean HasOwnHLRDeviationCoefficient() const { return myHasOwnHLRDeviationCoefficient; }
|
||||
|
||||
//! Returns the previous value of the hidden line removal deviation coefficient.
|
||||
Standard_Real PreviousHLRDeviationCoefficient() const
|
||||
{
|
||||
return myHasOwnHLRDeviationCoefficient
|
||||
? myPreviousHLRDeviationCoefficient
|
||||
: 0.0;
|
||||
}
|
||||
|
||||
//! Sets the deviation angle theAngle.
|
||||
//! Also sets the hasOwnDeviationAngle flag to Standard_True, and myPreviousDeviationAngle.
|
||||
Standard_EXPORT void SetDeviationAngle (const Standard_Real theAngle);
|
||||
|
||||
//! Returns the value for deviation angle.
|
||||
Standard_Real DeviationAngle() const
|
||||
{
|
||||
return HasOwnDeviationAngle() || myLink.IsNull()
|
||||
? myDeviationAngle
|
||||
: myLink->DeviationAngle();
|
||||
}
|
||||
|
||||
//! Sets the hasOwnDeviationAngle flag to Standard_False
|
||||
void SetDeviationAngle()
|
||||
{
|
||||
myHasOwnDeviationAngle = Standard_False;
|
||||
}
|
||||
|
||||
//! Returns true if the there is a local setting for deviation
|
||||
//! angle in this framework for a specific interactive object.
|
||||
Standard_Boolean HasOwnDeviationAngle() const { return myHasOwnDeviationAngle; }
|
||||
|
||||
//! Returns the previous deviation angle
|
||||
Standard_Real PreviousDeviationAngle() const
|
||||
{
|
||||
return myHasOwnDeviationAngle
|
||||
? myPreviousDeviationAngle
|
||||
: 0.0;
|
||||
}
|
||||
|
||||
//! Sets anAngle, the angle of maximum chordal deviation for removal of hidden lines created by
|
||||
//! different viewpoints in different presentations.
|
||||
//! The default value is 20 * M_PI / 180.
|
||||
//! Also sets the hasOwnHLRDeviationAngle flag to Standard_True and myPreviousHLRDeviationAngle.
|
||||
Standard_EXPORT void SetHLRAngle (const Standard_Real theAngle);
|
||||
|
||||
//! Returns the real number value of the deviation angle
|
||||
//! in hidden line removal views. The default value is 20 * M_PI / 180.
|
||||
Standard_Real HLRAngle() const
|
||||
{
|
||||
return HasOwnHLRDeviationAngle() || myLink.IsNull()
|
||||
? myHLRAngle
|
||||
: myLink->HLRAngle();
|
||||
}
|
||||
|
||||
//! Sets the hasOwnHLRDeviationAngle flag to Standard_False
|
||||
void SetHLRAngle()
|
||||
{
|
||||
myHasOwnHLRDeviationAngle = Standard_False;
|
||||
}
|
||||
|
||||
//! Returns true if the there is a setting for HLR deviation
|
||||
//! angle in this framework for a specific interactive object.
|
||||
Standard_Boolean HasOwnHLRDeviationAngle() const { return myHasOwnHLRDeviationAngle; }
|
||||
|
||||
//! Returns the previous value of the HLR deviation angle.
|
||||
Standard_Real PreviousHLRDeviationAngle() const
|
||||
{
|
||||
return myHasOwnHLRDeviationAngle
|
||||
? myPreviousHLRDeviationAngle
|
||||
: 0.0;
|
||||
}
|
||||
|
||||
//! Defines the attributes which are used when drawing an
|
||||
//! U isoparametric curve of a face. Defines the number
|
||||
//! of U isoparametric curves to be drawn for a single face.
|
||||
//! The LineAspect for U isoparametric lines can be edited
|
||||
//! (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
//! The default values are:
|
||||
//! COLOR : Quantity_NOC_GRAY75
|
||||
//! TYPE OF LINE: Aspect_TOL_SOLID
|
||||
//! WIDTH : 0.5
|
||||
//!
|
||||
//! These attributes are used by the following algorithms:
|
||||
//! Prs3d_WFDeflectionSurface
|
||||
//! Prs3d_WFDeflectionRestrictedFace
|
||||
Standard_EXPORT const Handle(Prs3d_IsoAspect)& UIsoAspect();
|
||||
|
||||
Standard_EXPORT void SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! UIso aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnUIsoAspect() const { return myHasOwnUIsoAspect; }
|
||||
|
||||
//! Defines the attributes which are used when drawing an
|
||||
//! V isoparametric curve of a face. Defines the number
|
||||
//! of V isoparametric curves to be drawn for a single face.
|
||||
//! The LineAspect for V isoparametric lines can be edited
|
||||
//! (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
//! The default values are:
|
||||
//! COLOR : Quantity_NOC_GRAY82
|
||||
//! TYPE OF LINE: Aspect_TOL_SOLID
|
||||
//! WIDTH : 0.5
|
||||
//!
|
||||
//! These attributes are used by the following algorithms:
|
||||
//! Prs3d_WFDeflectionSurface
|
||||
//! Prs3d_WFDeflectionRestrictedFace
|
||||
Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect();
|
||||
|
||||
//! Sets the appearance of V isoparameters - theAspect.
|
||||
Standard_EXPORT void SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! VIso aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnVIsoAspect() const { return myHasOwnVIsoAspect; }
|
||||
|
||||
//! Returns wire aspect settings.
|
||||
//! The LineAspect for the free boundaries can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_GREEN
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& WireAspect();
|
||||
|
||||
//! Sets the parameter theAspect for display of wires.
|
||||
Standard_EXPORT void SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! wire aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnWireAspect() const { return myHasOwnWireAspect; }
|
||||
|
||||
//! Sets WireDraw on or off by setting the parameter theIsEnabled to true or false.
|
||||
Standard_EXPORT void SetWireDraw(const Standard_Boolean theIsEnabled);
|
||||
|
||||
//! Returns True if the drawing of the wire is enabled.
|
||||
Standard_Boolean WireDraw() const
|
||||
{
|
||||
return HasOwnWireDraw() || myLink.IsNull()
|
||||
? myWireDraw
|
||||
: myLink->WireDraw();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! "draw wires" flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnWireDraw() const { return myHasOwnWireDraw; }
|
||||
|
||||
//! Returns the point aspect setting. The default values are
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of marker: Aspect_TOM_PLUS
|
||||
//! Scale: 1.0
|
||||
//! These attributes are used by the algorithms Prs3d_Point.
|
||||
Standard_EXPORT const Handle(Prs3d_PointAspect)& PointAspect();
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of points
|
||||
Standard_EXPORT void SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! point aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnPointAspect() const { return myHasOwnPointAspect; }
|
||||
|
||||
//! Returns settings for line aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! These attributes are used by the following algorithms:
|
||||
//! Prs3d_Curve
|
||||
//! Prs3d_Line
|
||||
//! Prs3d_HLRShape
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& LineAspect();
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of lines.
|
||||
Standard_EXPORT void SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! line aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnLineAspect() const { return myHasOwnLineAspect; }
|
||||
|
||||
//! Returns settings for text aspect.
|
||||
//! These settings can be edited. The default value is:
|
||||
//! - Color: Quantity_NOC_YELLOW
|
||||
Standard_EXPORT const Handle(Prs3d_TextAspect)& TextAspect();
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of text.
|
||||
Standard_EXPORT void SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! text aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnTextAspect() const { return myHasOwnTextAspect; }
|
||||
|
||||
//! Returns settings for shading aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! - Color: Quantity_NOC_YELLOW
|
||||
//! - Material: Graphic3d_NOM_BRASS
|
||||
//! Shading aspect is obtained through decomposition of
|
||||
//! 3d faces into triangles, each side of each triangle
|
||||
//! being a chord of the corresponding curved edge in the face.
|
||||
//! Reflection of light in each projector perspective is then calculated for each of the
|
||||
//! resultant triangular planes.
|
||||
Standard_EXPORT const Handle(Prs3d_ShadingAspect)& ShadingAspect();
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of shading.
|
||||
Standard_EXPORT void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! shading aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnShadingAspect() const { return myHasOwnShadingAspect; }
|
||||
|
||||
//! Returns True if the ShadingAspect is applied
|
||||
//! to the whole presentation.
|
||||
Standard_Boolean ShadingAspectGlobal() const
|
||||
{
|
||||
return HasOwnShadingAspectGlobal() || myLink.IsNull()
|
||||
? myShadingAspectGlobal
|
||||
: myLink->ShadingAspectGlobal();
|
||||
}
|
||||
|
||||
//! Indicates that the ShadingAspect will be apply
|
||||
//! to the whole presentation. This allows to modify
|
||||
//! the aspect without recomputing the content of the presentation.
|
||||
Standard_EXPORT void SetShadingAspectGlobal (const Standard_Boolean theValue);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! ShadingAspectGlobal flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnShadingAspectGlobal() const { return myHasOwnShadingAspectGlobal; }
|
||||
|
||||
//! Returns settings for seen line aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& SeenLineAspect();
|
||||
|
||||
//! Sets the parameter theAspect for the display of seen lines in hidden line removal mode.
|
||||
Standard_EXPORT void SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! seen line aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnSeenLineAspect() const { return myHasOwnSeenLineAspect; }
|
||||
|
||||
//! Returns settings for the appearance of planes.
|
||||
Standard_EXPORT const Handle(Prs3d_PlaneAspect)& PlaneAspect();
|
||||
|
||||
//! Sets the parameter theAspect for the display of planes.
|
||||
Standard_EXPORT void SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! plane aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnPlaneAspect() const { return myHasOwnPlaneAspect; }
|
||||
|
||||
//! Returns the attributes for display of arrows.
|
||||
Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect();
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of arrows.
|
||||
Standard_EXPORT void SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! arrow aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnArrowAspect() const { return myHasOwnArrowAspect; }
|
||||
|
||||
//! Enables the drawing of an arrow at the end of each line.
|
||||
//! By default the arrows are not drawn.
|
||||
Standard_EXPORT void SetLineArrowDraw (const Standard_Boolean theIsEnabled);
|
||||
|
||||
//! Returns True if drawing an arrow at the end of each edge is enabled
|
||||
//! and False otherwise (the default).
|
||||
Standard_Boolean LineArrowDraw() const
|
||||
{
|
||||
return HasOwnLineArrowDraw() || myLink.IsNull()
|
||||
? myLineArrowDraw
|
||||
: myLink->LineArrowDraw();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! "draw arrow" flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnLineArrowDraw() const
|
||||
{
|
||||
return myHasOwnLineArrowDraw;
|
||||
}
|
||||
|
||||
//! Returns settings for hidden line aspects.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_DASH
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& HiddenLineAspect();
|
||||
|
||||
//! Sets the parameter theAspect for the display of hidden lines in hidden line removal mode.
|
||||
Standard_EXPORT void SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! hidden lines aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnHiddenLineAspect() const { return myHasOwnHiddenLineAspect; }
|
||||
|
||||
//! Returns Standard_True if the hidden lines are to be drawn.
|
||||
//! By default the hidden lines are not drawn.
|
||||
Standard_Boolean DrawHiddenLine() const
|
||||
{
|
||||
return HasOwnDrawHiddenLine() || myLink.IsNull()
|
||||
? myDrawHiddenLine
|
||||
: myLink->DrawHiddenLine();
|
||||
}
|
||||
|
||||
//! Enables the DrawHiddenLine function.
|
||||
Standard_EXPORT void EnableDrawHiddenLine();
|
||||
|
||||
//! Disables the DrawHiddenLine function.
|
||||
Standard_EXPORT void DisableDrawHiddenLine();
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! "draw hidden lines" flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDrawHiddenLine() const { return myHasOwnDrawHiddenLine; }
|
||||
|
||||
//! Returns settings for the appearance of vectors.
|
||||
//! These settings can be edited. The default values are:
|
||||
//! Color: Quantity_NOC_SKYBLUE
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& VectorAspect();
|
||||
|
||||
//! Sets the modality theAspect for the display of vectors.
|
||||
Standard_EXPORT void SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! vector aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnVectorAspect() const { return myHasOwnVectorAspect; }
|
||||
|
||||
//! Sets the mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
//! By default, only stand-alone vertices (not belonging topologically to an edge) are drawn,
|
||||
//! that corresponds to Prs3d_VDM_Standalone mode.
|
||||
//! Switching to Prs3d_VDM_Standalone mode makes all shape's vertices visible.
|
||||
//! To inherit this parameter from the global drawer instance ("the link") when it is present,
|
||||
//! Prs3d_VDM_Inherited value should be used.
|
||||
Standard_EXPORT void SetVertexDrawMode (const Prs3d_VertexDrawMode theMode);
|
||||
|
||||
//! Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
Standard_EXPORT Prs3d_VertexDrawMode VertexDrawMode();
|
||||
|
||||
//! Returns true if the vertex draw mode is not equal to <b>Prs3d_VDM_Inherited</b>.
|
||||
//! This means that individual vertex draw mode value (i.e. not inherited from the global
|
||||
//! drawer) is used for a specific interactive object.
|
||||
Standard_Boolean HasOwnVertexDrawMode() const { return (myVertexDrawMode != Prs3d_VDM_Inherited); }
|
||||
|
||||
//! Returns settings for the appearance of datums.
|
||||
//! These settings can be edited. The default values for the three axes are:
|
||||
//! Color: Quantity_NOC_PEACHPUFF
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
Standard_EXPORT const Handle(Prs3d_DatumAspect)& DatumAspect();
|
||||
|
||||
//! Sets the modality theAspect for the display of datums.
|
||||
Standard_EXPORT void SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! datum aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDatumAspect() const { return myHasOwnDatumAspect; }
|
||||
|
||||
//! The LineAspect for the wire can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_ORANGE
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& SectionAspect();
|
||||
|
||||
//! Sets the parameter theAspect for display attributes of sections.
|
||||
Standard_EXPORT void SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! section aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnSectionAspect() const { return myHasOwnSectionAspect; }
|
||||
|
||||
//! Sets the parameter theAspect for the display of free boundaries.
|
||||
//! The method sets aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns the values for presentation of free boundaries,
|
||||
//! in other words, boundaries which are not shared.
|
||||
//! The LineAspect for the free boundaries can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_GREEN
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.0
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& FreeBoundaryAspect();
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! free boundaries aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFreeBoundaryAspect() const { return myHasOwnFreeBoundaryAspect; }
|
||||
|
||||
//! Enables or disables drawing of free boundaries for shading presentations.
|
||||
//! The method sets drawing flag owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
//! theIsEnabled is a boolean flag indicating whether the free boundaries should be
|
||||
//! drawn or not.
|
||||
Standard_EXPORT void SetFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
|
||||
|
||||
//! Returns True if the drawing of the free boundaries is enabled
|
||||
//! True is the default setting.
|
||||
Standard_Boolean FreeBoundaryDraw() const
|
||||
{
|
||||
return HasOwnFreeBoundaryDraw() || myLink.IsNull()
|
||||
? myFreeBoundaryDraw
|
||||
: myLink->FreeBoundaryDraw();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! "draw free boundaries" flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFreeBoundaryDraw() const { return myHasOwnFreeBoundaryDraw; }
|
||||
|
||||
//! Sets the parameter theAspect for the display of shared boundaries.
|
||||
//! The method sets aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns settings for shared boundary line aspects.
|
||||
//! The LineAspect for the unfree boundaries can be edited.
|
||||
//! The default values are:
|
||||
//! Color: Quantity_NOC_YELLOW
|
||||
//! Type of line: Aspect_TOL_SOLID
|
||||
//! Width: 1.
|
||||
//! These attributes are used by the algorithm Prs3d_WFShape
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& UnFreeBoundaryAspect();
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! unfree boundaries aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnUnFreeBoundaryAspect() const { return myHasOwnUnFreeBoundaryAspect; }
|
||||
|
||||
//! Enables or disables drawing of shared boundaries for shading presentations.
|
||||
//! The method sets drawing flag owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
//! theIsEnabled is a boolean flag indicating whether the shared boundaries should be drawn or not.
|
||||
Standard_EXPORT void SetUnFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
|
||||
|
||||
//! Returns True if the drawing of the shared boundaries is enabled.
|
||||
//! True is the default setting.
|
||||
Standard_Boolean UnFreeBoundaryDraw() const
|
||||
{
|
||||
return HasOwnUnFreeBoundaryDraw() || myLink.IsNull()
|
||||
? myUnFreeBoundaryDraw
|
||||
: myLink->UnFreeBoundaryDraw();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! "draw shared boundaries" flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnUnFreeBoundaryDraw() const { return myHasOwnUnFreeBoundaryDraw; }
|
||||
|
||||
//! Sets line aspect for face boundaries.
|
||||
//! The method sets line aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
//! theAspect is the line aspect that determines the look of the face boundaries.
|
||||
Standard_EXPORT void SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect);
|
||||
|
||||
//! Returns line aspect of face boundaries.
|
||||
Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect();
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! face boundaries aspect that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFaceBoundaryAspect() const { return myHasOwnFaceBoundaryAspect; }
|
||||
|
||||
//! Enables or disables face boundary drawing for shading presentations.
|
||||
//! The method sets drawing flag owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
//! theIsEnabled is a boolean flag indicating whether the face boundaries should be drawn or not.
|
||||
Standard_EXPORT void SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled);
|
||||
|
||||
//! Checks whether the face boundary drawing is enabled or not.
|
||||
Standard_Boolean FaceBoundaryDraw() const
|
||||
{
|
||||
return HasOwnFaceBoundaryDraw() || myLink.IsNull()
|
||||
? myFaceBoundaryDraw
|
||||
: myLink->FaceBoundaryDraw();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! "draw face boundaries" flag that overrides the one in the link.
|
||||
Standard_Boolean HasOwnFaceBoundaryDraw() const { return myHasOwnFaceBoundaryDraw; }
|
||||
|
||||
//! Returns settings for the appearance of dimensions.
|
||||
Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect();
|
||||
|
||||
//! Sets the settings for the appearance of dimensions.
|
||||
//! The method sets aspect owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect);
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! the appearance of dimensions that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDimensionAspect() const { return myHasOwnDimensionAspect; }
|
||||
|
||||
//! Sets dimension length model units for computing of dimension presentation.
|
||||
//! The method sets value owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetDimLengthModelUnits (const TCollection_AsciiString& theUnits);
|
||||
|
||||
//! Sets dimension angle model units for computing of dimension presentation.
|
||||
//! The method sets value owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetDimAngleModelUnits (const TCollection_AsciiString& theUnits);
|
||||
|
||||
//! Returns length model units for the dimension presentation.
|
||||
const TCollection_AsciiString& DimLengthModelUnits() const
|
||||
{
|
||||
return HasOwnDimLengthModelUnits() || myLink.IsNull()
|
||||
? myDimensionModelUnits.GetLengthUnits()
|
||||
: myLink->DimLengthModelUnits();
|
||||
}
|
||||
|
||||
//! Returns angle model units for the dimension presentation.
|
||||
const TCollection_AsciiString& DimAngleModelUnits() const
|
||||
{
|
||||
return HasOwnDimAngleModelUnits() || myLink.IsNull()
|
||||
? myDimensionModelUnits.GetAngleUnits()
|
||||
: myLink->DimAngleModelUnits();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! dimension length model units that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDimLengthModelUnits() const { return myHasOwnDimLengthModelUnits; }
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! dimension angle model units that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDimAngleModelUnits() const { return myHasOwnDimAngleModelUnits; }
|
||||
|
||||
//! Sets length units in which value for dimension presentation is displayed.
|
||||
//! The method sets value owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits);
|
||||
|
||||
//! Sets angle units in which value for dimension presentation is displayed.
|
||||
//! The method sets value owned by the drawer that will be used during
|
||||
//! visualization instead of the one set in link.
|
||||
Standard_EXPORT void SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits);
|
||||
|
||||
//! Returns length units in which dimension presentation is displayed.
|
||||
const TCollection_AsciiString& DimLengthDisplayUnits() const
|
||||
{
|
||||
return HasOwnDimLengthDisplayUnits() || myLink.IsNull()
|
||||
? myDimensionDisplayUnits.GetLengthUnits()
|
||||
: myLink->DimLengthDisplayUnits();
|
||||
}
|
||||
|
||||
//! Returns angle units in which dimension presentation is displayed.
|
||||
const TCollection_AsciiString& DimAngleDisplayUnits() const
|
||||
{
|
||||
return HasOwnDimAngleDisplayUnits() || myLink.IsNull()
|
||||
? myDimensionDisplayUnits.GetAngleUnits()
|
||||
: myLink->DimAngleDisplayUnits();
|
||||
}
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! length units in which dimension presentation is displayed
|
||||
//! that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDimLengthDisplayUnits() const { return myHasOwnDimLengthDisplayUnits; }
|
||||
|
||||
//! Returns true if the drawer has its own attribute for
|
||||
//! angle units in which dimension presentation is displayed
|
||||
//! that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDimAngleDisplayUnits() const { return myHasOwnDimAngleDisplayUnits; }
|
||||
|
||||
//! Returns the drawer to which the current object references.
|
||||
const Handle(Prs3d_Drawer)& Link() { return myLink; }
|
||||
|
||||
//! Returns true if the current object has a link on the other drawer.
|
||||
Standard_Boolean HasLink() const { return !myLink.IsNull(); }
|
||||
|
||||
//! Sets theDrawer as a link to which the current object references.
|
||||
void Link (const Handle(Prs3d_Drawer)& theDrawer)
|
||||
{
|
||||
myLink = theDrawer;
|
||||
}
|
||||
|
||||
//! Removes local attributes.
|
||||
Standard_EXPORT void ClearLocalAttributes();
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Prs3d_Drawer) myLink;
|
||||
|
||||
Standard_Integer myNbPoints;
|
||||
Standard_Boolean myHasOwnNbPoints;
|
||||
Standard_Real myMaximalParameterValue;
|
||||
Standard_Boolean myHasOwnMaximalParameterValue;
|
||||
Quantity_Length myChordialDeviation;
|
||||
Standard_Boolean myHasOwnChordialDeviation;
|
||||
Aspect_TypeOfDeflection myTypeOfDeflection;
|
||||
Standard_Boolean myHasOwnTypeOfDeflection;
|
||||
Prs3d_TypeOfHLR myTypeOfHLR;
|
||||
Standard_Real myDeviationCoefficient;
|
||||
Standard_Real myPreviousDeviationCoefficient;
|
||||
Standard_Boolean myHasOwnDeviationCoefficient;
|
||||
Standard_Real myHLRDeviationCoefficient;
|
||||
Standard_Boolean myHasOwnHLRDeviationCoefficient;
|
||||
Standard_Real myPreviousHLRDeviationCoefficient;
|
||||
Standard_Real myDeviationAngle;
|
||||
Standard_Boolean myHasOwnDeviationAngle;
|
||||
Standard_Real myPreviousDeviationAngle;
|
||||
Standard_Real myHLRAngle;
|
||||
Standard_Boolean myHasOwnHLRDeviationAngle;
|
||||
Standard_Real myPreviousHLRDeviationAngle;
|
||||
Standard_Boolean myIsoOnPlane;
|
||||
Standard_Boolean myHasOwnIsoOnPlane;
|
||||
|
||||
Handle(Prs3d_IsoAspect) myUIsoAspect;
|
||||
Standard_Boolean myHasOwnUIsoAspect;
|
||||
Handle(Prs3d_IsoAspect) myVIsoAspect;
|
||||
Standard_Boolean myHasOwnVIsoAspect;
|
||||
Handle(Prs3d_LineAspect) myWireAspect;
|
||||
Standard_Boolean myHasOwnWireAspect;
|
||||
Standard_Boolean myWireDraw;
|
||||
Standard_Boolean myHasOwnWireDraw;
|
||||
Handle(Prs3d_PointAspect) myPointAspect;
|
||||
Standard_Boolean myHasOwnPointAspect;
|
||||
Handle(Prs3d_LineAspect) myLineAspect;
|
||||
Standard_Boolean myHasOwnLineAspect;
|
||||
Handle(Prs3d_TextAspect) myTextAspect;
|
||||
Standard_Boolean myHasOwnTextAspect;
|
||||
Handle(Prs3d_ShadingAspect) myShadingAspect;
|
||||
Standard_Boolean myHasOwnShadingAspect;
|
||||
Standard_Boolean myShadingAspectGlobal;
|
||||
Standard_Boolean myHasOwnShadingAspectGlobal;
|
||||
Handle(Prs3d_PlaneAspect) myPlaneAspect;
|
||||
Standard_Boolean myHasOwnPlaneAspect;
|
||||
Handle(Prs3d_LineAspect) mySeenLineAspect;
|
||||
Standard_Boolean myHasOwnSeenLineAspect;
|
||||
Handle(Prs3d_ArrowAspect) myArrowAspect;
|
||||
Standard_Boolean myHasOwnArrowAspect;
|
||||
Standard_Boolean myLineArrowDraw;
|
||||
Standard_Boolean myHasOwnLineArrowDraw;
|
||||
Handle(Prs3d_LineAspect) myHiddenLineAspect;
|
||||
Standard_Boolean myHasOwnHiddenLineAspect;
|
||||
Standard_Boolean myDrawHiddenLine;
|
||||
Standard_Boolean myHasOwnDrawHiddenLine;
|
||||
Handle(Prs3d_LineAspect) myVectorAspect;
|
||||
Standard_Boolean myHasOwnVectorAspect;
|
||||
Prs3d_VertexDrawMode myVertexDrawMode;
|
||||
Handle(Prs3d_DatumAspect) myDatumAspect;
|
||||
Standard_Boolean myHasOwnDatumAspect;
|
||||
Handle(Prs3d_LineAspect) mySectionAspect;
|
||||
Standard_Boolean myHasOwnSectionAspect;
|
||||
|
||||
Handle(Prs3d_LineAspect) myFreeBoundaryAspect;
|
||||
Standard_Boolean myHasOwnFreeBoundaryAspect;
|
||||
Standard_Boolean myFreeBoundaryDraw;
|
||||
Standard_Boolean myHasOwnFreeBoundaryDraw;
|
||||
Handle(Prs3d_LineAspect) myUnFreeBoundaryAspect;
|
||||
Standard_Boolean myHasOwnUnFreeBoundaryAspect;
|
||||
Standard_Boolean myUnFreeBoundaryDraw;
|
||||
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
|
||||
Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
|
||||
Standard_Boolean myHasOwnFaceBoundaryAspect;
|
||||
Standard_Boolean myFaceBoundaryDraw;
|
||||
Standard_Boolean myHasOwnFaceBoundaryDraw;
|
||||
|
||||
Handle(Prs3d_DimensionAspect) myDimensionAspect;
|
||||
Standard_Boolean myHasOwnDimensionAspect;
|
||||
Prs3d_DimensionUnits myDimensionModelUnits;
|
||||
Standard_Boolean myHasOwnDimLengthModelUnits;
|
||||
Standard_Boolean myHasOwnDimAngleModelUnits;
|
||||
Prs3d_DimensionUnits myDimensionDisplayUnits;
|
||||
Standard_Boolean myHasOwnDimLengthDisplayUnits;
|
||||
Standard_Boolean myHasOwnDimAngleDisplayUnits;
|
||||
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTI(Prs3d_Drawer)
|
||||
|
||||
};
|
||||
|
||||
#endif // _Prs3d_Drawer_HeaderFile
|
@ -17,7 +17,7 @@
|
||||
class IsoAspect from Prs3d inherits LineAspect from Prs3d
|
||||
---Purpose: A framework to define the display attributes of isoparameters.
|
||||
-- This framework can be used to modify the default
|
||||
-- setting for isoparameters in AIS_Drawer.
|
||||
-- setting for isoparameters in Prs3d_Drawer.
|
||||
|
||||
uses
|
||||
|
||||
|
@ -1311,8 +1311,8 @@ static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, co
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
//=======================================================================
|
||||
//function : OCC1174_1
|
||||
@ -1326,44 +1326,47 @@ static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc,
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
|
||||
if(AISContext.IsNull())
|
||||
Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
|
||||
if(anAISContext.IsNull())
|
||||
{
|
||||
di << "use 'vinit' command before " << argv[0] << "\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TopoDS_Shape sh = DBRep::Get(argv[1]);
|
||||
TopoDS_Shape aShape = DBRep::Get(argv[1]);
|
||||
|
||||
Handle(AIS_Shape) ais = new AIS_Shape(sh);
|
||||
Handle(AIS_Shape) anAisIO = new AIS_Shape(aShape);
|
||||
|
||||
Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
|
||||
Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
|
||||
Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_RGB);
|
||||
Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_RGB);
|
||||
|
||||
Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
|
||||
Handle(Prs3d_Drawer) aDrawer = anAisIO->Attributes();
|
||||
Handle(Prs3d_ShadingAspect) aShadingAspect = aDrawer->ShadingAspect();
|
||||
|
||||
Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
|
||||
front.SetAmbientColor(colf);
|
||||
front.SetDiffuseColor(colf);
|
||||
front.SetSpecularColor(colf);
|
||||
front.SetEmissiveColor(colf);
|
||||
front.SetTransparency(0.0);
|
||||
sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
|
||||
Graphic3d_MaterialAspect aFront = aShadingAspect->Material(Aspect_TOFM_FRONT_SIDE);
|
||||
aFront.SetAmbientColor(aColF);
|
||||
aFront.SetDiffuseColor(aColF);
|
||||
aFront.SetSpecularColor(aColF);
|
||||
aFront.SetEmissiveColor(aColF);
|
||||
aFront.SetTransparency(0.0);
|
||||
aShadingAspect->SetMaterial(aFront,Aspect_TOFM_FRONT_SIDE);
|
||||
|
||||
Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
|
||||
back.SetAmbientColor(colb);
|
||||
back.SetDiffuseColor(colb);
|
||||
back.SetSpecularColor(colb);
|
||||
back.SetEmissiveColor(colb);
|
||||
back.SetTransparency(0.0);
|
||||
sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
|
||||
Graphic3d_MaterialAspect aBack = aShadingAspect->Material(Aspect_TOFM_BACK_SIDE);
|
||||
aBack.SetAmbientColor(aColB);
|
||||
aBack.SetDiffuseColor(aColB);
|
||||
aBack.SetSpecularColor(aColB);
|
||||
aBack.SetEmissiveColor(aColB);
|
||||
aBack.SetTransparency(0.0);
|
||||
aShadingAspect->SetMaterial(aBack,Aspect_TOFM_BACK_SIDE);
|
||||
|
||||
AISContext->Display(ais,1,0);
|
||||
aDrawer->SetShadingAspect (aShadingAspect);
|
||||
|
||||
anAISContext->Display(anAisIO, 1, 0);
|
||||
|
||||
Standard_Real r, g, b;
|
||||
sa->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
|
||||
aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
|
||||
di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
|
||||
sa->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
|
||||
aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
|
||||
di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
|
||||
|
||||
return 0;
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <BRepPrimAPI_MakeSphere.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
|
||||
//#include <AcisData_AcisModel.hxx>
|
||||
@ -47,7 +47,7 @@ static Standard_Integer BUC60738 (Draw_Interpretor& di, Standard_Integer /*argc*
|
||||
theAISShape->SetDisplayMode(1);
|
||||
|
||||
//get the drawer
|
||||
Handle(AIS_Drawer) theDrawer = theAISShape->Attributes();
|
||||
Handle(Prs3d_Drawer) theDrawer = theAISShape->Attributes();
|
||||
Handle(Prs3d_ShadingAspect) theShadingAspect = theDrawer->ShadingAspect();
|
||||
Handle(Graphic3d_AspectFillArea3d) theAspectFillArea3d = theShadingAspect->Aspect();
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <QABugs_MyText.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <Prs3d_Text.hxx>
|
||||
#include <Select3D_SensitiveBox.hxx>
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
QABugs_PresentableObject::QABugs_PresentableObject(const PrsMgr_TypeOfPresentation3d theTypeOfPresentation3d)
|
||||
:AIS_InteractiveObject(theTypeOfPresentation3d)
|
||||
|
@ -33,6 +33,7 @@ uses
|
||||
Selection from SelectMgr,
|
||||
SequenceOfSelection from SelectMgr,
|
||||
TypeOfPresentation3d from PrsMgr,
|
||||
Drawer from Prs3d,
|
||||
Presentation from Prs3d,
|
||||
PresentationManager from PrsMgr,
|
||||
PresentationManager3d from PrsMgr,
|
||||
@ -186,9 +187,21 @@ is
|
||||
---Purpose: Set Z layer ID and update all presentations of the selectable object.
|
||||
-- The layers mechanism allows drawing objects in higher layers in overlay of objects in lower layers.
|
||||
|
||||
SetAttributes(me:mutable; theDrawer: Drawer from Prs3d) is virtual;
|
||||
---Purpose: Initializes the drawing tool theDrawer.
|
||||
|
||||
Attributes(me) returns any Drawer from Prs3d;
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
---Purpose: Returns the attributes settings.
|
||||
|
||||
UnsetAttributes(me:mutable) is virtual;
|
||||
---Purpose: Clears settings provided by the drawing tool theDrawer.
|
||||
|
||||
fields
|
||||
|
||||
myselections : SequenceOfSelection is protected;
|
||||
myDrawer : Drawer from Prs3d is protected;
|
||||
mycurrent : Integer;
|
||||
myAutoHilight : Boolean from Standard;
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <SelectBasics_EntityOwner.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
@ -43,10 +44,11 @@ static Standard_Integer Search (const SelectMgr_SequenceOfSelection& seq,
|
||||
// Purpose :
|
||||
//==================================================
|
||||
|
||||
SelectMgr_SelectableObject::SelectMgr_SelectableObject( const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):PrsMgr_PresentableObject(aTypeOfPresentation3d)
|
||||
{
|
||||
myAutoHilight = Standard_True;
|
||||
}
|
||||
SelectMgr_SelectableObject::SelectMgr_SelectableObject( const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
|
||||
PrsMgr_PresentableObject (aTypeOfPresentation3d),
|
||||
myDrawer (new Prs3d_Drawer()),
|
||||
myAutoHilight (Standard_True)
|
||||
{}
|
||||
|
||||
|
||||
//==================================================
|
||||
@ -352,3 +354,27 @@ void SelectMgr_SelectableObject::SetZLayer (const Graphic3d_ZLayerId theLayerId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void SelectMgr_SelectableObject::SetAttributes (const Handle(Prs3d_Drawer)& theDrawer)
|
||||
{
|
||||
myDrawer = theDrawer;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void SelectMgr_SelectableObject::UnsetAttributes()
|
||||
{
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
aDrawer->Link (myDrawer->Link());
|
||||
}
|
||||
myDrawer = aDrawer;
|
||||
}
|
||||
|
||||
|
@ -25,4 +25,7 @@ inline const Handle(SelectMgr_Selection)& SelectMgr_SelectableObject::
|
||||
CurrentSelection() const
|
||||
{return myselections(mycurrent);}
|
||||
|
||||
inline const Handle(Prs3d_Drawer)& SelectMgr_SelectableObject::
|
||||
Attributes() const
|
||||
{return myDrawer;}
|
||||
|
||||
|
@ -544,7 +544,7 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
|
||||
(theVolume == StdPrs_Volume_Closed ? Standard_True : Standard_False));
|
||||
}
|
||||
|
||||
if (theDrawer->IsFaceBoundaryDraw())
|
||||
if (theDrawer->FaceBoundaryDraw())
|
||||
{
|
||||
computeFaceBoundaries (theShape, thePrs, theDrawer);
|
||||
}
|
||||
|
@ -38,7 +38,8 @@ uses
|
||||
TDataXtd,
|
||||
Geom,
|
||||
TopoDS,
|
||||
gp
|
||||
gp,
|
||||
Prs3d
|
||||
|
||||
|
||||
is
|
||||
|
@ -43,7 +43,7 @@ uses GUID from Standard,
|
||||
NameOfColor from Quantity,
|
||||
PlaneAngle from Quantity,
|
||||
NameOfMaterial from Graphic3d,
|
||||
Drawer from AIS
|
||||
Drawer from Prs3d
|
||||
is
|
||||
|
||||
GetID (myclass) returns GUID from Standard;
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <TDataXtd_Axis.hxx>
|
||||
#include <TDataXtd_Geometry.hxx>
|
||||
#include <AIS_Axis.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TDataXtd_Position.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Relation.hxx>
|
||||
|
||||
|
@ -47,7 +47,6 @@
|
||||
#include <AIS_SymmetricRelation.hxx>
|
||||
#include <AIS_MidPointRelation.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_EqualRadiusRelation.hxx>
|
||||
#include <AIS_EqualDistanceRelation.hxx>
|
||||
#include <AIS_MinRadiusDimension.hxx>
|
||||
@ -90,6 +89,7 @@
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota
|
||||
|
||||
@ -312,7 +312,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
|
||||
Standard_Boolean isEdge = Standard_False;
|
||||
|
||||
Standard_Boolean SaveDrw = Standard_False;
|
||||
Handle(AIS_Drawer) aDrawer;
|
||||
Handle(Prs3d_Drawer) aDrawer;
|
||||
Handle(AIS_LengthDimension) aDim;
|
||||
|
||||
if (!theAIS.IsNull())
|
||||
@ -1810,7 +1810,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
|
||||
Standard_Real val1;
|
||||
TCollection_ExtendedString txt;
|
||||
Handle(AIS_LengthDimension) ais;
|
||||
//Handle(AIS_Drawer) aDrawer;
|
||||
//Handle(Prs3d_Drawer) aDrawer;
|
||||
|
||||
if (nbgeom == 1)
|
||||
{
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_Circle.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
|
@ -18,7 +18,6 @@
|
||||
//#include <TDataStd_Datum.hxx>
|
||||
#include <TDataXtd_Geometry.hxx>
|
||||
#include <AIS_Plane.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include <TDataXtd_Geometry.hxx>
|
||||
//#include <TDataStd_Datum.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <Geom_Point.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <StdSelect_ShapeTypeFilter.hxx>
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_ColoredShape.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_Trihedron.hxx>
|
||||
@ -58,8 +57,10 @@
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Graphic3d_TextureRoot.hxx>
|
||||
#include <Image_AlienPixMap.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Select3D_SensitiveWire.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <StdSelect_BRepOwner.hxx>
|
||||
@ -90,8 +91,9 @@ extern int ViewerMainLoop(Standard_Integer argc, const char** argv);
|
||||
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
|
||||
#define DEFAULT_COLOR Quantity_NOC_GOLDENROD
|
||||
#define DEFAULT_MATERIAL Graphic3d_NOM_BRASS
|
||||
#define DEFAULT_COLOR Quantity_NOC_GOLDENROD
|
||||
#define DEFAULT_FREEBOUNDARY_COLOR Quantity_NOC_GREEN
|
||||
#define DEFAULT_MATERIAL Graphic3d_NOM_BRASS
|
||||
|
||||
//=======================================================================
|
||||
//function : GetColorFromName
|
||||
@ -594,7 +596,7 @@ static int visos (Draw_Interpretor& di, Standard_Integer argc, const char** argv
|
||||
if (anObj->IsKind(STANDARD_TYPE(AIS_InteractiveObject))) {
|
||||
const Handle(AIS_InteractiveObject) aShape =
|
||||
Handle(AIS_InteractiveObject)::DownCast (anObj);
|
||||
Handle(AIS_Drawer) CurDrawer = aShape->Attributes();
|
||||
Handle(Prs3d_Drawer) CurDrawer = aShape->Attributes();
|
||||
Handle(Prs3d_IsoAspect) aUIso = CurDrawer->UIsoAspect();
|
||||
Handle(Prs3d_IsoAspect) aVIso = CurDrawer->VIsoAspect();
|
||||
|
||||
@ -1395,6 +1397,12 @@ struct ViewerTest_AspectsChangeSet
|
||||
|
||||
NCollection_Sequence<TopoDS_Shape> SubShapes;
|
||||
|
||||
Standard_Integer ToSetShowFreeBoundary;
|
||||
Standard_Integer ToSetFreeBoundaryWidth;
|
||||
Standard_Real FreeBoundaryWidth;
|
||||
Standard_Integer ToSetFreeBoundaryColor;
|
||||
Quantity_Color FreeBoundaryColor;
|
||||
|
||||
//! Empty constructor
|
||||
ViewerTest_AspectsChangeSet()
|
||||
: ToSetVisibility (0),
|
||||
@ -1406,16 +1414,24 @@ struct ViewerTest_AspectsChangeSet
|
||||
ToSetTransparency (0),
|
||||
Transparency (0.0),
|
||||
ToSetMaterial (0),
|
||||
Material (Graphic3d_NOM_DEFAULT) {}
|
||||
Material (Graphic3d_NOM_DEFAULT),
|
||||
ToSetShowFreeBoundary (0),
|
||||
ToSetFreeBoundaryWidth (0),
|
||||
FreeBoundaryWidth (1.0),
|
||||
ToSetFreeBoundaryColor (0),
|
||||
FreeBoundaryColor (DEFAULT_FREEBOUNDARY_COLOR) {}
|
||||
|
||||
//! @return true if no changes have been requested
|
||||
Standard_Boolean IsEmpty() const
|
||||
{
|
||||
return ToSetVisibility == 0
|
||||
&& ToSetLineWidth == 0
|
||||
&& ToSetTransparency == 0
|
||||
&& ToSetColor == 0
|
||||
&& ToSetMaterial == 0;
|
||||
return ToSetVisibility == 0
|
||||
&& ToSetLineWidth == 0
|
||||
&& ToSetTransparency == 0
|
||||
&& ToSetColor == 0
|
||||
&& ToSetMaterial == 0
|
||||
&& ToSetShowFreeBoundary == 0
|
||||
&& ToSetFreeBoundaryColor == 0
|
||||
&& ToSetFreeBoundaryWidth == 0;
|
||||
}
|
||||
|
||||
//! @return true if properties are valid
|
||||
@ -1451,6 +1467,12 @@ struct ViewerTest_AspectsChangeSet
|
||||
std::cout << "Error: unknown material " << MatName << ".\n";
|
||||
isOk = Standard_False;
|
||||
}
|
||||
if (FreeBoundaryWidth <= 0.0
|
||||
|| FreeBoundaryWidth > 10.0)
|
||||
{
|
||||
std::cout << "Error: the free boundary width should be within [1; 10] range (specified " << FreeBoundaryWidth << ")\n";
|
||||
isOk = Standard_False;
|
||||
}
|
||||
return isOk;
|
||||
}
|
||||
|
||||
@ -1474,6 +1496,7 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
}
|
||||
|
||||
Standard_Integer anArgIter = 1;
|
||||
Standard_Boolean isDefaults = Standard_False;
|
||||
NCollection_Sequence<TCollection_AsciiString> aNames;
|
||||
for (; anArgIter < theArgNb; ++anArgIter)
|
||||
{
|
||||
@ -1489,10 +1512,21 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (anArg == "-defaults")
|
||||
{
|
||||
isDefaults = Standard_True;
|
||||
++anArgIter;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!aNames.IsEmpty() && isDefaults)
|
||||
{
|
||||
std::cout << "Error: wrong syntax. If -defaults is used there should not be any objects' names!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
NCollection_Sequence<ViewerTest_AspectsChangeSet> aChanges;
|
||||
aChanges.Append (ViewerTest_AspectsChangeSet());
|
||||
ViewerTest_AspectsChangeSet* aChangeSet = &aChanges.ChangeLast();
|
||||
@ -1770,6 +1804,12 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
else if (anArg == "-subshape"
|
||||
|| anArg == "-subshapes")
|
||||
{
|
||||
if (isDefaults)
|
||||
{
|
||||
std::cout << "Error: wrong syntax. -subshapes can not be used together with -defaults call!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (aNames.IsEmpty())
|
||||
{
|
||||
std::cout << "Error: main objects should specified explicitly when -subshapes is used!\n";
|
||||
@ -1803,6 +1843,106 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (anArg == "-freeboundary"
|
||||
|| anArg == "-fb")
|
||||
{
|
||||
if (++anArgIter >= theArgNb)
|
||||
{
|
||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||
return 1;
|
||||
}
|
||||
TCollection_AsciiString aValue (theArgVec[anArgIter]);
|
||||
aValue.LowerCase();
|
||||
if (aValue == "on"
|
||||
|| aValue == "1")
|
||||
{
|
||||
aChangeSet->ToSetShowFreeBoundary = 1;
|
||||
}
|
||||
else if (aValue == "off"
|
||||
|| aValue == "0")
|
||||
{
|
||||
aChangeSet->ToSetShowFreeBoundary = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (anArg == "-setfreeboundarywidth"
|
||||
|| anArg == "-setfbwidth")
|
||||
{
|
||||
if (++anArgIter >= theArgNb)
|
||||
{
|
||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||
return 1;
|
||||
}
|
||||
aChangeSet->ToSetFreeBoundaryWidth = 1;
|
||||
aChangeSet->FreeBoundaryWidth = Draw::Atof (theArgVec[anArgIter]);
|
||||
}
|
||||
else if (anArg == "-unsetfreeboundarywidth"
|
||||
|| anArg == "-unsetfbwidth")
|
||||
{
|
||||
aChangeSet->ToSetFreeBoundaryWidth = -1;
|
||||
aChangeSet->FreeBoundaryWidth = 1.0;
|
||||
}
|
||||
else if (anArg == "-setfreeboundarycolor"
|
||||
|| anArg == "-setfbcolor")
|
||||
{
|
||||
Standard_Integer aNbComps = 0;
|
||||
Standard_Integer aCompIter = anArgIter + 1;
|
||||
for (; aCompIter < theArgNb; ++aCompIter, ++aNbComps)
|
||||
{
|
||||
if (theArgVec[aCompIter][0] == '-')
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (aNbComps)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Quantity_NameOfColor aColor = Quantity_NOC_BLACK;
|
||||
Standard_CString aName = theArgVec[anArgIter + 1];
|
||||
if (!Quantity_Color::ColorFromName (aName, aColor))
|
||||
{
|
||||
std::cout << "Error: unknown free boundary color name '" << aName << "'\n";
|
||||
return 1;
|
||||
}
|
||||
aChangeSet->FreeBoundaryColor = aColor;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
Graphic3d_Vec3d anRgb;
|
||||
anRgb.x() = Draw::Atof (theArgVec[anArgIter + 1]);
|
||||
anRgb.y() = Draw::Atof (theArgVec[anArgIter + 2]);
|
||||
anRgb.z() = Draw::Atof (theArgVec[anArgIter + 3]);
|
||||
if (anRgb.x() < 0.0 || anRgb.x() > 1.0
|
||||
|| anRgb.y() < 0.0 || anRgb.y() > 1.0
|
||||
|| anRgb.z() < 0.0 || anRgb.z() > 1.0)
|
||||
{
|
||||
std::cout << "Error: free boundary RGB color values should be within range 0..1!\n";
|
||||
return 1;
|
||||
}
|
||||
aChangeSet->FreeBoundaryColor.SetValues (anRgb.x(), anRgb.y(), anRgb.z(), Quantity_TOC_RGB);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
std::cout << "Error: wrong syntax at " << anArg << "\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
aChangeSet->ToSetFreeBoundaryColor = 1;
|
||||
anArgIter += aNbComps;
|
||||
}
|
||||
else if (anArg == "-unsetfreeboundarycolor"
|
||||
|| anArg == "-unsetfbcolor")
|
||||
{
|
||||
aChangeSet->ToSetFreeBoundaryColor = -1;
|
||||
aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
|
||||
}
|
||||
else if (anArg == "-unset")
|
||||
{
|
||||
aChangeSet->ToSetVisibility = 1;
|
||||
@ -1815,6 +1955,11 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
aChangeSet->Color = DEFAULT_COLOR;
|
||||
aChangeSet->ToSetMaterial = -1;
|
||||
aChangeSet->Material = Graphic3d_NOM_DEFAULT;
|
||||
aChangeSet->ToSetShowFreeBoundary = -1;
|
||||
aChangeSet->ToSetFreeBoundaryColor = -1;
|
||||
aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
|
||||
aChangeSet->ToSetFreeBoundaryWidth = -1;
|
||||
aChangeSet->FreeBoundaryWidth = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1838,12 +1983,74 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
{
|
||||
aCtx->CloseLocalContext();
|
||||
}
|
||||
|
||||
// special case for -defaults parameter.
|
||||
// all changed values will be set to DefaultDrawer.
|
||||
if (isDefaults)
|
||||
{
|
||||
const Handle(Prs3d_Drawer)& aDrawer = aCtx->DefaultDrawer();
|
||||
|
||||
if (aChangeSet->ToSetLineWidth != 0)
|
||||
{
|
||||
aDrawer->LineAspect()->SetWidth (aChangeSet->LineWidth);
|
||||
aDrawer->WireAspect()->SetWidth (aChangeSet->LineWidth);
|
||||
aDrawer->UnFreeBoundaryAspect()->SetWidth (aChangeSet->LineWidth);
|
||||
aDrawer->SeenLineAspect()->SetWidth (aChangeSet->LineWidth);
|
||||
}
|
||||
if (aChangeSet->ToSetColor != 0)
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetColor (aChangeSet->Color);
|
||||
aDrawer->LineAspect()->SetColor (aChangeSet->Color);
|
||||
aDrawer->UnFreeBoundaryAspect()->SetColor (aChangeSet->Color);
|
||||
aDrawer->SeenLineAspect()->SetColor (aChangeSet->Color);
|
||||
aDrawer->WireAspect()->SetColor (aChangeSet->Color);
|
||||
aDrawer->PointAspect()->SetColor (aChangeSet->Color);
|
||||
}
|
||||
if (aChangeSet->ToSetTransparency != 0)
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetTransparency (aChangeSet->Transparency);
|
||||
}
|
||||
if (aChangeSet->ToSetMaterial != 0)
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetMaterial (aChangeSet->Material);
|
||||
}
|
||||
if (aChangeSet->ToSetShowFreeBoundary == 1)
|
||||
{
|
||||
aDrawer->SetFreeBoundaryDraw (Standard_True);
|
||||
}
|
||||
else if (aChangeSet->ToSetShowFreeBoundary == -1)
|
||||
{
|
||||
aDrawer->SetFreeBoundaryDraw (Standard_False);
|
||||
}
|
||||
if (aChangeSet->ToSetFreeBoundaryWidth != 0)
|
||||
{
|
||||
aDrawer->FreeBoundaryAspect()->SetWidth (aChangeSet->FreeBoundaryWidth);
|
||||
}
|
||||
if (aChangeSet->ToSetFreeBoundaryColor != 0)
|
||||
{
|
||||
aDrawer->FreeBoundaryAspect()->SetColor (aChangeSet->FreeBoundaryColor);
|
||||
}
|
||||
|
||||
// redisplay all objects in context
|
||||
for (ViewTest_PrsIter aPrsIter (aNames); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aPrs = aPrsIter.Current();
|
||||
if (!aPrs.IsNull())
|
||||
{
|
||||
aCtx->Redisplay (aPrs, Standard_False);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (ViewTest_PrsIter aPrsIter (aNames); aPrsIter.More(); aPrsIter.Next())
|
||||
{
|
||||
const TCollection_AsciiString& aName = aPrsIter.CurrentName();
|
||||
Handle(AIS_InteractiveObject) aPrs = aPrsIter.Current();
|
||||
const TCollection_AsciiString& aName = aPrsIter.CurrentName();
|
||||
Handle(AIS_InteractiveObject) aPrs = aPrsIter.Current();
|
||||
Handle(Prs3d_Drawer) aDrawer = aPrs->Attributes();
|
||||
Handle(AIS_ColoredShape) aColoredPrs;
|
||||
Standard_Boolean toDisplay = Standard_False;
|
||||
Standard_Boolean toRedisplay = Standard_False;
|
||||
if (aChanges.Length() > 1 || aChangeSet->ToSetVisibility == 1)
|
||||
{
|
||||
Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast (aPrs);
|
||||
@ -1906,6 +2113,37 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
{
|
||||
aCtx->UnsetWidth (aPrs, Standard_False);
|
||||
}
|
||||
if (!aDrawer.IsNull())
|
||||
{
|
||||
if (aChangeSet->ToSetShowFreeBoundary == 1)
|
||||
{
|
||||
aDrawer->SetFreeBoundaryDraw (Standard_True);
|
||||
toRedisplay = Standard_True;
|
||||
}
|
||||
else if (aChangeSet->ToSetShowFreeBoundary == -1)
|
||||
{
|
||||
aDrawer->SetFreeBoundaryDraw (Standard_False);
|
||||
toRedisplay = Standard_True;
|
||||
}
|
||||
if (aChangeSet->ToSetFreeBoundaryWidth != 0)
|
||||
{
|
||||
Handle(Prs3d_LineAspect) aBoundaryAspect =
|
||||
new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0);
|
||||
*aBoundaryAspect->Aspect() = *aDrawer->FreeBoundaryAspect()->Aspect();
|
||||
aBoundaryAspect->SetWidth (aChangeSet->FreeBoundaryWidth);
|
||||
aDrawer->SetFreeBoundaryAspect (aBoundaryAspect);
|
||||
toRedisplay = Standard_True;
|
||||
}
|
||||
if (aChangeSet->ToSetFreeBoundaryColor != 0)
|
||||
{
|
||||
Handle(Prs3d_LineAspect) aBoundaryAspect =
|
||||
new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0);
|
||||
*aBoundaryAspect->Aspect() = *aDrawer->FreeBoundaryAspect()->Aspect();
|
||||
aBoundaryAspect->SetColor (aChangeSet->FreeBoundaryColor);
|
||||
aDrawer->SetFreeBoundaryAspect (aBoundaryAspect);
|
||||
toRedisplay = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
for (aChangesIter.Next(); aChangesIter.More(); aChangesIter.Next())
|
||||
{
|
||||
@ -1938,6 +2176,10 @@ static Standard_Integer VAspects (Draw_Interpretor& /*theDI*/,
|
||||
{
|
||||
aCtx->Display (aPrs, Standard_False);
|
||||
}
|
||||
if (toRedisplay)
|
||||
{
|
||||
aCtx->Redisplay (aPrs, Standard_False);
|
||||
}
|
||||
else if (!aColoredPrs.IsNull())
|
||||
{
|
||||
aColoredPrs->Redisplay();
|
||||
@ -4659,16 +4901,23 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands)
|
||||
__FILE__,VSubInt,group);
|
||||
|
||||
theCommands.Add("vaspects",
|
||||
"vaspects [-noupdate|-update] [name1 [name2 [...]]]"
|
||||
"vaspects [-noupdate|-update] [name1 [name2 [...]] | -defaults]"
|
||||
"\n\t\t: [-setvisibility 0|1]"
|
||||
"\n\t\t: [-setcolor ColorName] [-setcolor R G B] [-unsetcolor]"
|
||||
"\n\t\t: [-setmaterial MatName] [-unsetmaterial]"
|
||||
"\n\t\t: [-settransparency Transp] [-unsettransparency]"
|
||||
"\n\t\t: [-setwidth LineWidth] [-unsetwidth]"
|
||||
"\n\t\t: [-freeBoundary {off/on | 0/1}]"
|
||||
"\n\t\t: [-setFreeBoundaryWidth Width] [-unsetFreeBoundaryWidth]"
|
||||
"\n\t\t: [-setFreeBoundaryColor {ColorName | R G B}] [-unsetFreeBoundaryColor]"
|
||||
"\n\t\t: [-subshapes subname1 [subname2 [...]]]"
|
||||
"\n\t\t: Manage presentation properties of all, selected or named objects."
|
||||
"\n\t\t: When -subshapes is specified than following properties will be"
|
||||
"\n\t\t: assigned to specified sub-shapes.",
|
||||
"\n\t\t: assigned to specified sub-shapes."
|
||||
"\n\t\t: When -defaults is specified than presentation properties will be"
|
||||
"\n\t\t: assigned to all objects that have not their own specified properties"
|
||||
"\n\t\t: and to all objects to be displayed in the future."
|
||||
"\n\t\t: If -defaults is used there should not be any objects' names and -subshapes specifier.",
|
||||
__FILE__,VAspects,group);
|
||||
|
||||
theCommands.Add("vsetcolor",
|
||||
|
@ -99,7 +99,6 @@
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
#include <AIS_Circle.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
@ -128,6 +127,7 @@
|
||||
#include <BRepExtrema_ExtPC.hxx>
|
||||
#include <BRepExtrema_ExtPF.hxx>
|
||||
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_VertexDrawMode.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
@ -2514,10 +2514,13 @@ void MyTextClass::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresent
|
||||
|
||||
aPresentation->Clear();
|
||||
|
||||
if (!myDrawer->HasTextAspect())
|
||||
if (!myDrawer->HasOwnTextAspect())
|
||||
{
|
||||
myDrawer->SetTextAspect (new Prs3d_TextAspect());
|
||||
*myDrawer->TextAspect()->Aspect() = *myDrawer->Link()->TextAspect()->Aspect();
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->TextAspect()->Aspect() = *myDrawer->Link()->TextAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
Handle(Prs3d_TextAspect) asp = myDrawer->TextAspect();
|
||||
@ -3771,6 +3774,7 @@ static Standard_Integer VConnect (Draw_Interpretor& /*di*/,
|
||||
continue;
|
||||
}
|
||||
anObject = new AIS_Shape (aTDShape);
|
||||
aContext->Load (anObject);
|
||||
anObject->SetColor (ViewerTest::GetColorFromName (aColorName));
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include <ViewerTest.hxx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Draw.hxx>
|
||||
@ -34,6 +33,7 @@
|
||||
#include <OpenGl_Workspace.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <OSD_File.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include <OpenGl_GlCore20.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_ListOfInteractive.hxx>
|
||||
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||
@ -73,6 +72,7 @@
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
#ifdef WNT
|
||||
#undef DrawText
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user