#include <Prs3d_LineAspect.hxx>
#include <StdPrs_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_ArrowAspect.hxx>
#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>
#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>
#include <gp_Pnt2d.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax2.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#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>
#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>
#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>
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);
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);
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)
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)
#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>
#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>
#include "DsgPrs_LengthPresentation.hxx"
#include "Prs3d_ArrowAspect.hxx"
-#include "AIS_Drawer.hxx"
+#include "Prs3d_Drawer.hxx"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
# pragma comment (lib,"TKernel.lib")
*/
-#include <AIS_Drawer.hxx>
#include <AIS_Circle.hxx>
#include <AIS_Line.hxx>
#include <AIS_InteractiveContext.hxx>
#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>
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);
#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)
#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>
#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>
#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>
#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>
#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>
#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)
#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>
# pragma comment (lib,"TKXS214.lib")
*/
-#include <AIS_Drawer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_Shape.hxx>
#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>
*/
-#include <AIS_Drawer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_Shape.hxx>
#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>
#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)
#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>
#include <AIS_InteractiveObject.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
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();
#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>
imported ColoredShape;
imported TexturedShape;
- class Drawer;
-
class InteractiveContext;
class GraphicTool;
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;
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;
//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
//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
// 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
#include <AIS_AngleDimension.hxx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <gp_Ax2.hxx>
#include <Geom_Line.hxx>
#include <GeomAdaptor_Curve.hxx>
-#include <AIS_Drawer.hxx>
#include <DsgPrs_XYZAxisPresentation.hxx>
#include <UnitsAPI.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <ProjLib.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <ProjLib.hxx>
#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>
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);
{
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);
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;
}
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;
}
#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>
#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)
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);
}
continue;
}
- if (aDrawer->HasLineAspect())
+ if (aDrawer->HasOwnLineAspect())
{
aDrawer->LineAspect()->SetWidth (theLineWidth);
}
- if (aDrawer->HasWireAspect())
+ if (aDrawer->HasOwnWireAspect())
{
aDrawer->WireAspect()->SetWidth (theLineWidth);
}
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);
}
{
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()
}
{
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;
#ifndef _AIS_ColoredShape_HeaderFile
#define _AIS_ColoredShape_HeaderFile
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
#include <AIS_Shape.hxx>
#include <NCollection_DataMap.hxx>
#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)
};
-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
#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>
#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>
+++ /dev/null
--- 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;
-
-
+++ /dev/null
-// 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;
-}
+++ /dev/null
-// 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();
-}
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,
-- 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;
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;
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;
#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
//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,
//=======================================================================
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,
//=======================================================================
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,
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
//=======================================================================
//function : AIS_EqualRadiusRelation
#include <AIS.hxx>
#include <AIS_Shape.hxx>
-#include <AIS_Drawer.hxx>
#include <BRep_Tool.hxx>
MapOfInteractive from AIS,
InteractiveObject from AIS,
DisplayMode from AIS,
- Drawer from AIS,
NameOfMaterial from Graphic3d,
--NameOfPhysicalMaterial from Graphic3d,
Filter from SelectMgr,
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
-- 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:
//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())
Box from Bnd,
NameOfMaterial from Graphic3d,
MaterialAspect from Graphic3d,
- Drawer from AIS,
PToContext from AIS,
TypeOfPresentation3d from PrsMgr,
InteractiveContext from AIS,
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
-- 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;
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),
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());
}
//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;
}
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 :
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;
//=======================================================================
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();
//=======================================================================
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);
// 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;
Standard_Boolean AIS_InteractiveObject::HasPolygonOffsets() const
{
return !( myDrawer->ShadingAspect().IsNull() ||
- ( !myDrawer->Link().IsNull() &&
+ ( myDrawer->HasLink() &&
myDrawer->ShadingAspect() == myDrawer->Link()->ShadingAspect() ) );
}
//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;}
#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>
class Prs3d_Projector;
class Geom_Transformation;
class SelectMgr_Selection;
-class AIS_Drawer;
class Bnd_Box;
class gp_Dir;
class TopoDS_Vertex;
#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>
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);
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;
}
{
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);
}
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;
}
#include <gp_Vec.hxx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <Precision.hxx>
#include <DsgPrs_EllipseRadiusPresentation.hxx>
#include <Precision.hxx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <gce_MakeLin.hxx>
#include <ElCLib.hxx>
#include <gp_Vec.hxx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <Precision.hxx>
#include <DsgPrs_EllipseRadiusPresentation.hxx>
#include <AIS_OffsetDimension.ixx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRep_Tool.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <Poly_Triangulation.hxx>
-#include <AIS_Drawer.hxx>
-
#include <TCollection_AsciiString.hxx>
//=======================================================================
DA = myDrawer->DatumAspect();
Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
- if(myDrawer->Link()->PlaneAspect() == PA){
+ if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
yenavaitPA = Standard_False;
PA = new Prs3d_PlaneAspect();}
- if(myDrawer->Link()->DatumAspect() == DA){
+ if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
yenavaitDA = Standard_False;
DA = new Prs3d_DatumAspect();
}
{
if(!myHasOwnSize) return;
- if(!hasOwnColor){
- myDrawer->PlaneAspect().Nullify();
- myDrawer->DatumAspect().Nullify();
+ if(!hasOwnColor)
+ {
+ myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
+ myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
}
else{
- const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
- const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
+ const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
+ new Prs3d_PlaneAspect();
+ const Handle(Prs3d_DatumAspect) DA = myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() :
+ new Prs3d_DatumAspect();
myDrawer->PlaneAspect()->SetPlaneLength(PA->PlaneXLength(),PA->PlaneYLength());
myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
DA = myDrawer->DatumAspect();
Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
- if(myDrawer->Link()->PlaneAspect() == PA){
+ if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
yenavaitPA = Standard_False;
PA = new Prs3d_PlaneAspect();}
- if(myDrawer->Link()->DatumAspect() == DA){
+ if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
yenavaitDA = Standard_False;
DA = new Prs3d_DatumAspect();
}
void AIS_Plane::UnsetColor()
{
if(!hasOwnColor) return;
- if(!myHasOwnSize){
- myDrawer->PlaneAspect().Nullify();
- myDrawer->DatumAspect().Nullify();
+ if(!myHasOwnSize)
+ {
+ myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
+ myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
}
else{
- const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
+ const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
+ new Prs3d_PlaneAspect();
// const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
Quantity_Color C;Aspect_TypeOfLine T;Standard_Real W;
PA->EdgesAspect()->Aspect()->Values(C,T,W);
#include <Graphic3d_MaterialAspect.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Aspect_TypeOfLine.hxx>
-#include <AIS_Drawer.hxx>
#include <UnitsAPI.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <StdPrs_Point.hxx>
#include <Geom_Point.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <AIS_Drawer.hxx>
#include <AIS_InteractiveContext.hxx>
//=======================================================================
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;
if(myHasTOM) aTOM = myTOM;
- if(myDrawer->HasPointAspect()){
+ if(myDrawer->HasOwnPointAspect()){
// CLE
// const Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
#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>
{
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
}
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())
//=======================================================================
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;
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())
{
}
Handle(Graphic3d_AspectMarker3d) aMarkerAspect = myDrawer->PointAspect()->Aspect();
- if (!myDrawer->HasPointAspect())
+ if (!myDrawer->HasOwnPointAspect())
{
aMarkerAspect->SetType (Aspect_TOM_POINT);
}
#include <AIS_Relation.ixx>
-#include <AIS_Drawer.hxx>
#include <AIS_GraphicTool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRep_Tool.hxx>
#include <Geom_Line.hxx>
#include <Geom_CartesianPoint.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_PointAspect.hxx>
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();
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();
// 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();
{
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);
}
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());
}
//=======================================================================
-- 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.
Projector from Prs3d,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
- Drawer from AIS,
KindOfInteractive from AIS,
Transformation from Geom,
Drawer from Prs3d,
---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) ;
---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) ;
-- 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 ;
---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;
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)
#include <AIS_GraphicTool.hxx>
#include <AIS_InteractiveContext.hxx>
-#include <AIS_Drawer.hxx>
#include <HLRBRep.hxx>
#include <Precision.hxx>
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);
}
Handle (Prs3d_Drawer) defdrawer = GetContext()->DefaultDrawer();
- if (defdrawer->DrawHiddenLine())
+ if (defdrawer->DrawHiddenLine())
{myDrawer->EnableDrawHiddenLine();}
else {myDrawer->DisableDrawHiddenLine();}
//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());
}
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())
//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());
}
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);
}
//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);
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);
//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
void AIS_Shape::UnsetTransparency()
{
myTransparency = 0.0;
- if (!myDrawer->HasShadingAspect())
+ if (!myDrawer->HasOwnShadingAspect())
{
return;
}
Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient ()
{
- Standard_Boolean itSet = myDrawer->IsOwnDeviationCoefficient();
+ Standard_Boolean itSet = myDrawer->HasOwnDeviationCoefficient();
if(itSet) myDrawer->SetDeviationCoefficient();
return itSet;
}
Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient ()
{
- Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationCoefficient();
+ Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationCoefficient();
if(itSet) myDrawer->SetHLRDeviationCoefficient();
return itSet;
Standard_Boolean AIS_Shape::SetOwnDeviationAngle ()
{
- Standard_Boolean itSet = myDrawer->IsOwnDeviationAngle();
+ Standard_Boolean itSet = myDrawer->HasOwnDeviationAngle();
if(itSet) myDrawer->SetDeviationAngle();
return itSet;
Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
{
- Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationAngle();
+ Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationAngle();
if(itSet) myDrawer->SetHLRAngle();
return itSet;
{
aCoefficient = myDrawer->DeviationCoefficient();
aPreviousCoefficient = myDrawer->PreviousDeviationCoefficient ();
- return myDrawer->IsOwnDeviationCoefficient() ;
+ return myDrawer->HasOwnDeviationCoefficient() ;
}
//=======================================================================
{
aCoefficient = myDrawer->HLRDeviationCoefficient();
aPreviousCoefficient = myDrawer->PreviousHLRDeviationCoefficient ();
- return myDrawer->IsOwnHLRDeviationCoefficient();
+ return myDrawer->HasOwnHLRDeviationCoefficient();
}
{
anAngle = myDrawer->DeviationAngle();
aPreviousAngle = myDrawer->PreviousDeviationAngle ();
- return myDrawer->IsOwnDeviationAngle();
+ return myDrawer->HasOwnDeviationAngle();
}
//=======================================================================
{
anAngle = myDrawer->HLRAngle();
aPreviousAngle = myDrawer->PreviousHLRDeviationAngle ();
- return myDrawer->IsOwnHLRDeviationAngle();
+ return myDrawer->HasOwnHLRDeviationAngle();
}
// 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)
{
#include <AIS_SymmetricRelation.ixx>
#include <AIS.hxx>
-#include <AIS_Drawer.hxx>
#include <gce_MakeLin.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <AIS_TexturedShape.hxx>
-#include <AIS_Drawer.hxx>
#include <AIS_GraphicTool.hxx>
#include <AIS_InteractiveContext.hxx>
#include <BRepTools.hxx>
#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>
// 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>
-- 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
#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>
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);
}
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();
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();
}
//=======================================================================
{
// 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(),
hasOwnColor=Standard_True;
myOwnColor = aCol;
- if(!myDrawer->HasDatumAspect()){
+ if(!myDrawer->HasOwnDatumAspect()){
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
myHasOwnTextColor = Standard_True;
myOwnTextColor = aCol;
- if(!myDrawer->HasDatumAspect()){
+ if(!myDrawer->HasOwnDatumAspect()){
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
myHasOwnArrowColor = Standard_True;
myOwnArrowColor = aCol;
- if(!myDrawer->HasDatumAspect()){
+ if(!myDrawer->HasOwnDatumAspect()){
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
#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>
#include <PPrsStd_AISPresentation.hxx>
#include <TPrsStd_AISPresentation.hxx>
-#include <AIS_Drawer.hxx>
#include <TCollection_ExtendedString.hxx>
#include <PCollection_HExtendedString.hxx>
#include <Quantity_NameOfColor.hxx>
#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>
#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>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_TextureParams.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Graphic3d_TypeOfTextureMode.hxx>
#include <Standard_DefineHandle.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
-#include <AIS_Drawer.hxx>
#include <Quantity_Array1OfColor.hxx>
#include <Aspect_SequenceOfColor.hxx>
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;
Prs3d_DimensionUnits.cxx
Prs3d_PresentationShadow.hxx
Prs3d_PresentationShadow.cxx
+Prs3d_Drawer.hxx
+Prs3d_Drawer.cxx
---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;
class DatumAspect;
imported DimensionUnits;
- class Drawer;
+ imported transient class Drawer;
class Projector;
+++ /dev/null
--- 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;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Prs3d_Drawer.ixx>
+#include <Prs3d_Drawer.hxx>
+#include <Prs3d_ArrowAspect.hxx>
+#include <Prs3d_DatumAspect.hxx>
+#include <Prs3d_DimensionAspect.hxx>
+#include <Prs3d_IsoAspect.hxx>
+#include <Prs3d_LineAspect.hxx>
+#include <Prs3d_PlaneAspect.hxx>
+#include <Prs3d_PointAspect.hxx>
+#include <Prs3d_ShadingAspect.hxx>
+#include <Prs3d_TextAspect.hxx>
+
+IMPLEMENT_STANDARD_HANDLE (Prs3d_Drawer, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Drawer, MMgt_TShared)
// =======================================================================
// function : Prs3d_Drawer
// purpose :
// =======================================================================
Prs3d_Drawer::Prs3d_Drawer()
-: myNbPoints (30),
- myIsoOnPlane (Standard_False),
- myFreeBoundaryDraw (Standard_True),
- myUnFreeBoundaryDraw (Standard_True),
- myWireDraw (Standard_True),
- myShadingAspect (new Prs3d_ShadingAspect()),
- myShadingAspectGlobal (Standard_True),
- myChordialDeviation (0.0001),
- myTypeOfDeflection (Aspect_TOD_RELATIVE),
- myMaximalParameterValue (500000.),
- myDeviationCoefficient (0.001),
- myHLRDeviationCoefficient (0.02),
- myDeviationAngle (12.0 * M_PI / 180.0),
- myHLRAngle (20.0 * M_PI / 180.0),
- myVertexDrawMode (Prs3d_VDM_Isolated),
- myLineDrawArrow (Standard_False),
- myDrawHiddenLine (Standard_False),
- myFaceBoundaryDraw (Standard_False),
- myTypeOfHLR (Prs3d_TOH_PolyAlgo)
+: myNbPoints (30),
+ myHasOwnNbPoints (Standard_False),
+ myMaximalParameterValue (500000.),
+ myHasOwnMaximalParameterValue (Standard_False),
+ myChordialDeviation (0.0001),
+ myHasOwnChordialDeviation (Standard_False),
+ myTypeOfDeflection (Aspect_TOD_RELATIVE),
+ myHasOwnTypeOfDeflection (Standard_False),
+ myTypeOfHLR (Prs3d_TOH_NotSet),
+ myDeviationCoefficient (0.001),
+ myHasOwnDeviationCoefficient (Standard_False),
+ myHLRDeviationCoefficient (0.02),
+ myHasOwnHLRDeviationCoefficient (Standard_False),
+ myDeviationAngle (12.0 * M_PI / 180.0),
+ myHasOwnDeviationAngle (Standard_False),
+ myHLRAngle (20.0 * M_PI / 180.0),
+ myHasOwnHLRDeviationAngle (Standard_False),
+ myIsoOnPlane (Standard_False),
+ myHasOwnIsoOnPlane (Standard_False),
+
+ myHasOwnUIsoAspect (Standard_False),
+ myHasOwnVIsoAspect (Standard_False),
+ myHasOwnWireAspect (Standard_False),
+ myWireDraw (Standard_True),
+ myHasOwnWireDraw (Standard_False),
+ myHasOwnPointAspect (Standard_False),
+ myHasOwnLineAspect (Standard_False),
+ myHasOwnTextAspect (Standard_False),
+ myHasOwnShadingAspect (Standard_False),
+ myShadingAspectGlobal (Standard_True),
+ myHasOwnShadingAspectGlobal (Standard_False),
+ myHasOwnPlaneAspect (Standard_False),
+ myHasOwnSeenLineAspect (Standard_False),
+ myHasOwnArrowAspect (Standard_False),
+ myLineArrowDraw (Standard_False),
+ myHasOwnLineArrowDraw (Standard_False),
+ myHasOwnHiddenLineAspect (Standard_False),
+ myDrawHiddenLine (Standard_False),
+ myHasOwnDrawHiddenLine (Standard_False),
+ myHasOwnVectorAspect (Standard_False),
+ myVertexDrawMode (Prs3d_VDM_Inherited),
+ myHasOwnDatumAspect (Standard_False),
+ myHasOwnSectionAspect (Standard_False),
+
+ myHasOwnFreeBoundaryAspect (Standard_False),
+ myFreeBoundaryDraw (Standard_True),
+ myHasOwnFreeBoundaryDraw (Standard_False),
+ myHasOwnUnFreeBoundaryAspect (Standard_False),
+ myUnFreeBoundaryDraw (Standard_True),
+ myHasOwnUnFreeBoundaryDraw (Standard_False),
+ myHasOwnFaceBoundaryAspect (Standard_False),
+ myFaceBoundaryDraw (Standard_False),
+ myHasOwnFaceBoundaryDraw (Standard_False),
+
+ myHasOwnDimensionAspect (Standard_False),
+ myHasOwnDimLengthModelUnits (Standard_False),
+ myHasOwnDimAngleModelUnits (Standard_False),
+ myHasOwnDimLengthDisplayUnits (Standard_False),
+ myHasOwnDimAngleDisplayUnits (Standard_False)
{
myDimensionModelUnits.SetLengthUnits ("m");
myDimensionModelUnits.SetAngleUnits ("rad");
myDimensionDisplayUnits.SetAngleUnits ("deg");
}
-void Prs3d_Drawer::SetTypeOfDeflection(const Aspect_TypeOfDeflection aTypeOfDeflection){
-
- myTypeOfDeflection = aTypeOfDeflection;}
-
-Aspect_TypeOfDeflection Prs3d_Drawer::TypeOfDeflection() const {
-
- return myTypeOfDeflection;
-
-}
+// =======================================================================
+// function : SetTypeOfDeflection
+// purpose :
+// =======================================================================
-
-void Prs3d_Drawer::SetIsoOnPlane(const Standard_Boolean OnOff)
+void Prs3d_Drawer::SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection)
{
- myIsoOnPlane = OnOff;
+ myHasOwnTypeOfDeflection = Standard_True;
+ myTypeOfDeflection = theTypeOfDeflection;
}
-
-Standard_Boolean Prs3d_Drawer::IsoOnPlane()const
+// =======================================================================
+// function : SetMaximalChordialDeviation
+// purpose :
+// =======================================================================
+
+void Prs3d_Drawer::SetMaximalChordialDeviation (const Quantity_Length theChordialDeviation)
{
- return myIsoOnPlane;
+ myHasOwnChordialDeviation = Standard_True;
+ myChordialDeviation = theChordialDeviation;
}
+// =======================================================================
+// function : SetTypeOfHLR
+// purpose : set type of HLR algorithm
+// =======================================================================
-Standard_Integer Prs3d_Drawer::Discretisation() const
+void Prs3d_Drawer::SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)
{
- return myNbPoints;
+ myTypeOfHLR = theTypeOfHLR;
}
+// =======================================================================
+// function : TypeOfHLR
+// purpose : gets type of HLR algorithm
+// =======================================================================
-void Prs3d_Drawer::SetDiscretisation(const Standard_Integer d)
+Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR()
{
- myNbPoints = d;
+ if (!HasOwnTypeOfHLR())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->TypeOfHLR();
+ }
+ // Prs3d_TOH_PolyAlgo is default value for this setting.
+ myTypeOfHLR = Prs3d_TOH_PolyAlgo;
+ }
+ return myTypeOfHLR;
}
+// =======================================================================
+// function : SetMaximalParameterValue
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetMaximalChordialDeviation(
- const Quantity_Length aChordialDeviation) {
- myChordialDeviation = aChordialDeviation;
+void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real theValue)
+{
+ myHasOwnMaximalParameterValue = Standard_True;
+ myMaximalParameterValue = theValue;
}
-Quantity_Length Prs3d_Drawer::MaximalChordialDeviation() const {
- return myChordialDeviation;
-}
+// =======================================================================
+// function : SetIsoOnPlane
+// purpose :
+// =======================================================================
-//
-//=======================================================================
-//function : SetDeviationCoefficient
-//purpose :
-//=======================================================================
+void Prs3d_Drawer::SetIsoOnPlane (const Standard_Boolean theIsEnabled)
+{
+ myHasOwnIsoOnPlane = Standard_True;
+ myIsoOnPlane = theIsEnabled;
+}
-void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real aCoefficient) {
+// =======================================================================
+// function : SetDiscretisation
+// purpose :
+// =======================================================================
- myDeviationCoefficient = aCoefficient;
+void Prs3d_Drawer::SetDiscretisation (const Standard_Integer theValue)
+{
+ myHasOwnNbPoints = Standard_True;
+ myNbPoints = theValue;
}
//=======================================================================
-//function : DeviationCoefficient
+//function : SetDeviationCoefficient
//purpose :
//=======================================================================
-Standard_Real Prs3d_Drawer::DeviationCoefficient () const {
-
- return myDeviationCoefficient;
+void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real theCoefficient)
+{
+ myPreviousDeviationCoefficient = DeviationCoefficient();
+ myDeviationCoefficient = theCoefficient;
+ myHasOwnDeviationCoefficient = Standard_True;
}
//=======================================================================
//purpose :
//=======================================================================
-void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real aCoefficient) {
-
- myHLRDeviationCoefficient = aCoefficient;
+void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real theCoefficient)
+{
+ myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient();
+ myHLRDeviationCoefficient = theCoefficient;
+ myHasOwnHLRDeviationCoefficient = Standard_True;
}
//=======================================================================
-//function : HLRDeviationCoefficient
+//function : SetDeviationAngle
//purpose :
//=======================================================================
-Standard_Real Prs3d_Drawer::HLRDeviationCoefficient () const {
-
- return myHLRDeviationCoefficient;
+void Prs3d_Drawer::SetDeviationAngle (const Standard_Real theAngle)
+{
+ myPreviousDeviationAngle = DeviationAngle();
+ myDeviationAngle = theAngle;
+ myHasOwnDeviationAngle = Standard_True;
}
//=======================================================================
//purpose :
//=======================================================================
-void Prs3d_Drawer::SetHLRAngle (const Standard_Real anAngle) {
-
- myHLRAngle = anAngle;
+void Prs3d_Drawer::SetHLRAngle (const Standard_Real theAngle)
+{
+ myPreviousHLRDeviationAngle = HLRAngle();
+ myHLRAngle = theAngle;
+ myHasOwnHLRDeviationAngle = Standard_True;
}
-//=======================================================================
-//function : HLRAngle
-//purpose :
-//=======================================================================
-
-Standard_Real Prs3d_Drawer::HLRAngle () const {
+// =======================================================================
+// function : FreeBoundaryAspect
+// purpose :
+// =======================================================================
- return myHLRAngle;
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FreeBoundaryAspect()
+{
+ if (!HasOwnFreeBoundaryAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->FreeBoundaryAspect();
+ }
+ if (myFreeBoundaryAspect.IsNull())
+ {
+ myFreeBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 1.0);
+ }
+ }
+ return myFreeBoundaryAspect;
}
-//=======================================================================
-//function : SetDeviationAngle
-//purpose :
-//=======================================================================
+// =======================================================================
+// function : FreeBoundaryAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetDeviationAngle (const Standard_Real anAngle)
+void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
- myDeviationAngle = anAngle;
+ myFreeBoundaryAspect = theAspect;
+ myHasOwnFreeBoundaryAspect = !myFreeBoundaryAspect.IsNull();
}
-//=======================================================================
-//function : DeviationAngle
-//purpose :
-//=======================================================================
+// =======================================================================
+// function : SetFreeBoundaryDraw
+// purpose :
+// =======================================================================
-Standard_Real Prs3d_Drawer::DeviationAngle () const
+void Prs3d_Drawer::SetFreeBoundaryDraw (const Standard_Boolean theIsEnabled)
{
- return myDeviationAngle;
+ myHasOwnFreeBoundaryDraw = Standard_True;
+ myFreeBoundaryDraw = theIsEnabled;
}
+// =======================================================================
+// function : UnFreeBoundaryAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real Value) {
- myMaximalParameterValue = Value;
-}
-
-Standard_Real Prs3d_Drawer::MaximalParameterValue () const {
- return myMaximalParameterValue;
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::UnFreeBoundaryAspect()
+{
+ if (!HasOwnUnFreeBoundaryAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->UnFreeBoundaryAspect();
+ }
+ if (myUnFreeBoundaryAspect.IsNull())
+ {
+ myUnFreeBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
+ }
+ }
+ return myUnFreeBoundaryAspect;
}
-Handle (Prs3d_IsoAspect) Prs3d_Drawer::UIsoAspect (){
-
- if (myUIsoAspect.IsNull())
- myUIsoAspect = new Prs3d_IsoAspect
- (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1);
-
- return myUIsoAspect;
-}
+// =======================================================================
+// function : SetUnFreeBoundaryAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetUIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) {
- myUIsoAspect = anAspect;
+void Prs3d_Drawer::SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+ myUnFreeBoundaryAspect = theAspect;
+ myHasOwnUnFreeBoundaryAspect = !myUnFreeBoundaryAspect.IsNull();
}
-Handle (Prs3d_IsoAspect) Prs3d_Drawer::VIsoAspect () {
- if (myVIsoAspect.IsNull())
- myVIsoAspect = new Prs3d_IsoAspect
- (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1);
-
- return myVIsoAspect;
-}
+// =======================================================================
+// function : SetUnFreeBoundaryDraw
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetVIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) {
- myVIsoAspect = anAspect;
+void Prs3d_Drawer::SetUnFreeBoundaryDraw (const Standard_Boolean theIsEnabled)
+{
+ myHasOwnUnFreeBoundaryDraw = Standard_True;
+ myUnFreeBoundaryDraw = theIsEnabled;
}
-Handle (Prs3d_LineAspect) Prs3d_Drawer::FreeBoundaryAspect () {
- if (myFreeBoundaryAspect.IsNull())
- myFreeBoundaryAspect = new Prs3d_LineAspect
- (Quantity_NOC_GREEN,Aspect_TOL_SOLID,1.);
-
- return myFreeBoundaryAspect;
-}
+// =======================================================================
+// function : FaceBoundaryAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& anAspect) {
- myFreeBoundaryAspect = anAspect;
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FaceBoundaryAspect()
+{
+ if (!HasOwnFaceBoundaryAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->FaceBoundaryAspect();
+ }
+ if (myFaceBoundaryAspect.IsNull())
+ {
+ myFaceBoundaryAspect = new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0);
+ }
+ }
+ return myFaceBoundaryAspect;
}
-void Prs3d_Drawer::SetFreeBoundaryDraw ( const Standard_Boolean OnOff ) {
- myFreeBoundaryDraw = OnOff;
-}
+// =======================================================================
+// function : SetFaceBoundaryAspect
+// purpose :
+// =======================================================================
-Standard_Boolean Prs3d_Drawer::FreeBoundaryDraw () const {
-return myFreeBoundaryDraw;
+void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+ myFaceBoundaryAspect = theAspect;
+ myHasOwnFaceBoundaryAspect = !myFaceBoundaryAspect.IsNull();
}
-Handle (Prs3d_LineAspect) Prs3d_Drawer::UnFreeBoundaryAspect (){
- if (myUnFreeBoundaryAspect.IsNull())
- myUnFreeBoundaryAspect = new Prs3d_LineAspect
- (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
- return myUnFreeBoundaryAspect;
-}
+// =======================================================================
+// function : SetFaceBoundaryDraw
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetUnFreeBoundaryAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myUnFreeBoundaryAspect = anAspect;
+void Prs3d_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
+{
+ myHasOwnFaceBoundaryDraw = Standard_True;
+ myFaceBoundaryDraw = theIsEnabled;
}
-void Prs3d_Drawer::SetUnFreeBoundaryDraw ( const Standard_Boolean OnOff ) {
- myUnFreeBoundaryDraw = OnOff;
-}
+// =======================================================================
+// function : DimensionAspect
+// purpose :
+// =======================================================================
-Standard_Boolean Prs3d_Drawer::UnFreeBoundaryDraw () const {
- return myUnFreeBoundaryDraw;
+const Handle(Prs3d_DimensionAspect)& Prs3d_Drawer::DimensionAspect()
+{
+ if (!HasOwnDimensionAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->DimensionAspect();
+ }
+ if (myDimensionAspect.IsNull())
+ {
+ myDimensionAspect = new Prs3d_DimensionAspect;
+ }
+ }
+ return myDimensionAspect;
}
-Handle (Prs3d_LineAspect) Prs3d_Drawer::WireAspect () {
- if (myWireAspect.IsNull())
- myWireAspect = new Prs3d_LineAspect(Quantity_NOC_RED,Aspect_TOL_SOLID,1.);
+// =======================================================================
+// function : SetDimensionAspect
+// purpose :
+// =======================================================================
- return myWireAspect;
+void Prs3d_Drawer::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
+{
+ myDimensionAspect = theAspect;
+ myHasOwnDimensionAspect = !myDimensionAspect.IsNull();
}
-void Prs3d_Drawer::SetWireAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myWireAspect = anAspect;
-}
-void Prs3d_Drawer::SetWireDraw ( const Standard_Boolean OnOff ) {
- myWireDraw = OnOff;
-}
+// =======================================================================
+// function : SetDimLengthModelUnits
+// purpose :
+// =======================================================================
-Standard_Boolean Prs3d_Drawer::WireDraw () const {
-return myWireDraw;
+void Prs3d_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
+{
+ myHasOwnDimLengthModelUnits = Standard_True;
+ myDimensionModelUnits.SetLengthUnits (theUnits);
}
+// =======================================================================
+// function : SetDimAngleModelUnits
+// purpose :
+// =======================================================================
-Handle (Prs3d_LineAspect) Prs3d_Drawer::LineAspect () {
- if (myLineAspect.IsNull())
- myLineAspect = new Prs3d_LineAspect
- (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
- return myLineAspect;
+void Prs3d_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
+{
+ myHasOwnDimAngleModelUnits = Standard_True;
+ myDimensionModelUnits.SetAngleUnits (theUnits);
}
-void Prs3d_Drawer::SetLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myLineAspect = anAspect;
+// =======================================================================
+// function : SetDimLengthDisplayUnits
+// purpose :
+// =======================================================================
+
+void Prs3d_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
+{
+ myHasOwnDimLengthDisplayUnits = Standard_True;
+ myDimensionDisplayUnits.SetLengthUnits (theUnits);
}
-Handle (Prs3d_TextAspect) Prs3d_Drawer::TextAspect () {
- if (myTextAspect.IsNull())
- myTextAspect = new Prs3d_TextAspect();
+// =======================================================================
+// function : SetDimAngleDisplayUnits
+// purpose :
+// =======================================================================
- return myTextAspect;
+void Prs3d_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
+{
+ myHasOwnDimAngleDisplayUnits = Standard_True;
+ myDimensionDisplayUnits.SetAngleUnits (theUnits);
}
-void Prs3d_Drawer::SetTextAspect ( const Handle(Prs3d_TextAspect)& anAspect) {
- myTextAspect = anAspect;
+// =======================================================================
+// function : UIsoAspect
+// purpose :
+// =======================================================================
+
+const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::UIsoAspect()
+{
+ if (!HasOwnUIsoAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->UIsoAspect();
+ }
+ if (myUIsoAspect.IsNull())
+ {
+ myUIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1);
+ }
+ }
+ return myUIsoAspect;
}
-Handle (Prs3d_ShadingAspect) Prs3d_Drawer::ShadingAspect () {
- if (myShadingAspect.IsNull())
- myShadingAspect = new Prs3d_ShadingAspect();
+// =======================================================================
+// function : SetUIsoAspect
+// purpose :
+// =======================================================================
- return myShadingAspect;
+void Prs3d_Drawer::SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
+{
+ myUIsoAspect = theAspect;
+ myHasOwnUIsoAspect = !myUIsoAspect.IsNull();
}
-void Prs3d_Drawer::SetShadingAspect ( const Handle(Prs3d_ShadingAspect)& anAspect) {
- myShadingAspect = anAspect;
-}
+// =======================================================================
+// function : VIsoAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetShadingAspectGlobal(const Standard_Boolean aValue) {
- myShadingAspectGlobal = aValue;
+const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::VIsoAspect()
+{
+ if (!HasOwnVIsoAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->VIsoAspect();
+ }
+ if (myVIsoAspect.IsNull())
+ {
+ myVIsoAspect = new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1);
+ }
+ }
+ return myVIsoAspect;
}
-Standard_Boolean Prs3d_Drawer::ShadingAspectGlobal() const {
-
- return myShadingAspectGlobal;
+// =======================================================================
+// function : SetVIsoAspect
+// purpose :
+// =======================================================================
+void Prs3d_Drawer::SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
+{
+ myVIsoAspect = theAspect;
+ myHasOwnVIsoAspect= !myVIsoAspect.IsNull();
}
-
-void Prs3d_Drawer::SetLineArrowDraw ( const Standard_Boolean OnOff ) {
- myLineDrawArrow = OnOff;
-}
-Standard_Boolean Prs3d_Drawer::LineArrowDraw () const {
-return myLineDrawArrow;
+// =======================================================================
+// function : WireAspect
+// purpose :
+// =======================================================================
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::WireAspect()
+{
+ if (!HasOwnWireAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->WireAspect();
+ }
+ if (myWireAspect.IsNull())
+ {
+ myWireAspect = new Prs3d_LineAspect (Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0);
+ }
+ }
+ return myWireAspect;
}
-Handle (Prs3d_ArrowAspect) Prs3d_Drawer::ArrowAspect() {
- if (myArrowAspect.IsNull())
- myArrowAspect = new Prs3d_ArrowAspect;
+// =======================================================================
+// function : SetWireAspect
+// purpose :
+// =======================================================================
- return myArrowAspect;
+void Prs3d_Drawer::SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+ myWireAspect = theAspect;
+ myHasOwnWireAspect = !myWireAspect.IsNull();
}
-void Prs3d_Drawer::SetArrowAspect ( const Handle(Prs3d_ArrowAspect)& anAspect) {
- myArrowAspect = anAspect;
+// =======================================================================
+// function : SetWireDraw
+// purpose :
+// =======================================================================
+
+void Prs3d_Drawer::SetWireDraw (const Standard_Boolean theIsEnabled)
+{
+ myHasOwnWireDraw = Standard_True;
+ myWireDraw = theIsEnabled;
}
-Handle (Prs3d_PointAspect) Prs3d_Drawer::PointAspect() {
- if (myPointAspect.IsNull())
- myPointAspect = new Prs3d_PointAspect
- (Aspect_TOM_PLUS,Quantity_NOC_YELLOW,1.);
+// =======================================================================
+// function : PointAspect
+// purpose :
+// =======================================================================
+const Handle(Prs3d_PointAspect)& Prs3d_Drawer::PointAspect()
+{
+ if (!HasOwnPointAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->PointAspect();
+ }
+ if (myPointAspect.IsNull())
+ {
+ myPointAspect = new Prs3d_PointAspect (Aspect_TOM_PLUS, Quantity_NOC_YELLOW, 1.0);
+ }
+ }
return myPointAspect;
}
-void Prs3d_Drawer::SetPointAspect ( const Handle(Prs3d_PointAspect)& anAspect) {
- myPointAspect = anAspect;
-}
+// =======================================================================
+// function : SetPointAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
+void Prs3d_Drawer::SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
{
- // Prs3d_VDM_Inherited value is allowed at AIS_Drawer level.
- // Replacing it by Prs3d_VDM_Isolated to avoid unpredictable behavior.
- myVertexDrawMode = (theMode == Prs3d_VDM_Inherited ? Prs3d_VDM_Isolated : theMode);
+ myPointAspect = theAspect;
+ myHasOwnPointAspect = !myPointAspect.IsNull();
}
-Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode () const
+// =======================================================================
+// function : LineAspect
+// purpose :
+// =======================================================================
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::LineAspect()
{
- return myVertexDrawMode;
+ if (!HasOwnLineAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->LineAspect();
+ }
+ if (myLineAspect.IsNull())
+ {
+ myLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
+ }
+ }
+ return myLineAspect;
}
-Standard_Boolean Prs3d_Drawer::DrawHiddenLine () const {return myDrawHiddenLine;}
-
-void Prs3d_Drawer::EnableDrawHiddenLine () {myDrawHiddenLine=Standard_True;}
-
-void Prs3d_Drawer::DisableDrawHiddenLine () {myDrawHiddenLine=Standard_False;}
-
-Handle (Prs3d_LineAspect) Prs3d_Drawer::HiddenLineAspect () {
- if (myHiddenLineAspect.IsNull())
- myHiddenLineAspect = new Prs3d_LineAspect
- (Quantity_NOC_YELLOW,Aspect_TOL_DASH,0.5);
-
- return myHiddenLineAspect;
-}
+// =======================================================================
+// function : SetLineAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetHiddenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myHiddenLineAspect = anAspect;
+void Prs3d_Drawer::SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+ myLineAspect = theAspect;
+ myHasOwnLineAspect = !myLineAspect.IsNull();
}
-Handle (Prs3d_LineAspect) Prs3d_Drawer::SeenLineAspect () {
- if (mySeenLineAspect.IsNull())
- mySeenLineAspect = new Prs3d_LineAspect
- (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.);
-
- return mySeenLineAspect;
-}
+// =======================================================================
+// function : TextAspect
+// purpose :
+// =======================================================================
-void Prs3d_Drawer::SetSeenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- mySeenLineAspect = anAspect;
+const Handle(Prs3d_TextAspect)& Prs3d_Drawer::TextAspect()
+{
+ if (!HasOwnTextAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->TextAspect();
+ }
+ if (myTextAspect.IsNull())
+ {
+ myTextAspect = new Prs3d_TextAspect();
+ }
+ }
+ return myTextAspect;
}
-Handle (Prs3d_LineAspect) Prs3d_Drawer::VectorAspect () {
- if (myVectorAspect.IsNull())
- myVectorAspect = new Prs3d_LineAspect
- (Quantity_NOC_SKYBLUE,Aspect_TOL_SOLID,1.);
+// =======================================================================
+// function : SetTextAspect
+// purpose :
+// =======================================================================
- return myVectorAspect;
+void Prs3d_Drawer::SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect)
+{
+ myTextAspect = theAspect;
+ myHasOwnTextAspect = !myTextAspect.IsNull();
}
-void Prs3d_Drawer::SetVectorAspect ( const Handle(Prs3d_LineAspect)& anAspect) {
- myVectorAspect = anAspect;
+// =======================================================================
+// function : ShadingAspect
+// purpose :
+// =======================================================================
+
+const Handle(Prs3d_ShadingAspect)& Prs3d_Drawer::ShadingAspect()
+{
+ if (!HasOwnShadingAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->ShadingAspect();
+ }
+ if (myShadingAspect.IsNull())
+ {
+ myShadingAspect = new Prs3d_ShadingAspect();
+ }
+ }
+ return myShadingAspect;
}
-Handle (Prs3d_DatumAspect) Prs3d_Drawer::DatumAspect () {
- if (myDatumAspect.IsNull())
- myDatumAspect = new Prs3d_DatumAspect;
+// =======================================================================
+// function : SetShadingAspect
+// purpose :
+// =======================================================================
- return myDatumAspect;
+void Prs3d_Drawer::SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect)
+{
+ myShadingAspect = theAspect;
+ myHasOwnShadingAspect = !myShadingAspect.IsNull();
}
-void Prs3d_Drawer::SetDatumAspect ( const Handle(Prs3d_DatumAspect)& anAspect) {
- myDatumAspect = anAspect;
+// =======================================================================
+// function : SetShadingAspectGlobal
+// purpose :
+// =======================================================================
+
+void Prs3d_Drawer::SetShadingAspectGlobal (const Standard_Boolean theValue)
+{
+ myHasOwnShadingAspectGlobal = Standard_True;
+ myShadingAspectGlobal = theValue;
}
-Handle (Prs3d_PlaneAspect) Prs3d_Drawer::PlaneAspect () {
- if (myPlaneAspect.IsNull())
- myPlaneAspect = new Prs3d_PlaneAspect;
+// =======================================================================
+// function : PlaneAspect
+// purpose :
+// =======================================================================
+const Handle(Prs3d_PlaneAspect)& Prs3d_Drawer::PlaneAspect()
+{
+ if (!HasOwnPlaneAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->PlaneAspect();
+ }
+ if (myPlaneAspect.IsNull())
+ {
+ myPlaneAspect = new Prs3d_PlaneAspect();
+ }
+ }
return myPlaneAspect;
}
-void Prs3d_Drawer::SetPlaneAspect ( const Handle(Prs3d_PlaneAspect)& anAspect) {
- myPlaneAspect = anAspect;
+// =======================================================================
+// function : SetPlaneAspect
+// purpose :
+// =======================================================================
+
+void Prs3d_Drawer::SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect)
+{
+ myPlaneAspect = theAspect;
+ myHasOwnPlaneAspect = !myPlaneAspect.IsNull();
}
// =======================================================================
-// function : DimensionAspect
+// function : SeenLineAspect
// purpose :
// =======================================================================
-Handle(Prs3d_DimensionAspect) Prs3d_Drawer::DimensionAspect()
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SeenLineAspect()
{
- if (myDimensionAspect.IsNull())
+ if (!HasOwnSeenLineAspect())
{
- myDimensionAspect = new Prs3d_DimensionAspect;
+ if (!myLink.IsNull())
+ {
+ return myLink->SeenLineAspect();
+ }
+ if (mySeenLineAspect.IsNull())
+ {
+ mySeenLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_SOLID, 1.0);
+ }
}
-
- return myDimensionAspect;
+ return mySeenLineAspect;
}
// =======================================================================
-// function : SetDimensionAspect
+// function : SetSeenLineAspect
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
+
+void Prs3d_Drawer::SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
- myDimensionAspect = theAspect;
+ mySeenLineAspect = theAspect;
+ myHasOwnSeenLineAspect = !mySeenLineAspect.IsNull();
}
// =======================================================================
-// function : SetDimLengthModelUnits
+// function : ArrowAspect
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
+
+const Handle(Prs3d_ArrowAspect)& Prs3d_Drawer::ArrowAspect()
{
- myDimensionModelUnits.SetLengthUnits (theUnits);
+ if (!HasOwnArrowAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->ArrowAspect();
+ }
+ if (myArrowAspect.IsNull())
+ {
+ myArrowAspect = new Prs3d_ArrowAspect();
+ }
+ }
+ return myArrowAspect;
}
// =======================================================================
-// function : SetDimAngleModelUnits
+// function : SetArrowAspect
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
+
+void Prs3d_Drawer::SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect)
{
- myDimensionModelUnits.SetAngleUnits (theUnits);
+ myArrowAspect = theAspect;
+ myHasOwnArrowAspect = !myArrowAspect.IsNull();
}
// =======================================================================
-// function : DimLengthModelUnits
+// function : SetLineArrowDraw
// purpose :
// =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimLengthModelUnits() const
+
+void Prs3d_Drawer::SetLineArrowDraw (const Standard_Boolean theIsEnabled)
{
- return myDimensionModelUnits.GetLengthUnits();
+ myHasOwnLineArrowDraw = Standard_True;
+ myLineArrowDraw = theIsEnabled;
}
// =======================================================================
-// function : DimAngleModelUnits
+// function : HiddenLineAspect
// purpose :
// =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimAngleModelUnits() const
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::HiddenLineAspect()
{
- return myDimensionModelUnits.GetAngleUnits();
+ if (!HasOwnHiddenLineAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->HiddenLineAspect();
+ }
+ if (myHiddenLineAspect.IsNull())
+ {
+ myHiddenLineAspect = new Prs3d_LineAspect (Quantity_NOC_YELLOW, Aspect_TOL_DASH, 0.5);
+ }
+ }
+ return myHiddenLineAspect;
}
// =======================================================================
-// function : SetDimLengthDisplayUnits
+// function : SetHiddenLineAspect
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
+
+void Prs3d_Drawer::SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
- myDimensionDisplayUnits.SetLengthUnits (theUnits);
+ myHiddenLineAspect = theAspect;
+ myHasOwnHiddenLineAspect = !myHiddenLineAspect.IsNull();
}
// =======================================================================
-// function : SetDimAngleDisplayUnits
+// function : EnableDrawHiddenLineDraw
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
+
+void Prs3d_Drawer::EnableDrawHiddenLine()
{
- myDimensionDisplayUnits.SetAngleUnits (theUnits);
+ myHasOwnDrawHiddenLine = Standard_True;
+ myDrawHiddenLine = Standard_True;
}
// =======================================================================
-// function : DimLengthDisplayUnits
+// function : DisableDrawHiddenLine
// purpose :
// =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimLengthDisplayUnits() const
+
+void Prs3d_Drawer::DisableDrawHiddenLine()
{
- return myDimensionDisplayUnits.GetLengthUnits();
+ myHasOwnDrawHiddenLine = Standard_True;
+ myDrawHiddenLine = Standard_False;
}
// =======================================================================
-// function : DimAngleDisplayUnits
+// function : VectorAspect
// purpose :
// =======================================================================
-const TCollection_AsciiString& Prs3d_Drawer::DimAngleDisplayUnits() const
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::VectorAspect()
{
- return myDimensionDisplayUnits.GetAngleUnits();
+ if (!HasOwnVectorAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->VectorAspect();
+ }
+ if (myVectorAspect.IsNull())
+ {
+ myVectorAspect = new Prs3d_LineAspect (Quantity_NOC_SKYBLUE, Aspect_TOL_SOLID, 1.0);
+ }
+ }
+ return myVectorAspect;
}
// =======================================================================
-// function : SectionAspect
+// function : SetVectorAspect
// purpose :
// =======================================================================
-Handle (Prs3d_LineAspect) Prs3d_Drawer::SectionAspect()
-{
- if (mySectionAspect.IsNull())
- {
- mySectionAspect = new Prs3d_LineAspect (Quantity_NOC_ORANGE, Aspect_TOL_SOLID, 1.0);
- }
- return mySectionAspect;
+void Prs3d_Drawer::SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect)
+{
+ myVectorAspect = theAspect;
+ myHasOwnVectorAspect = !myVectorAspect.IsNull();
}
// =======================================================================
-// function : SetSectionAspect
+// function : SetVertexDrawMode
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
+
+void Prs3d_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
{
- mySectionAspect = theAspect;
+ // Prs3d_VDM_Inherited is default value and means
+ // that correct value should be taken from the Link if it exists.
+ myVertexDrawMode = theMode;
}
// =======================================================================
-// function : SetFaceBoundaryDraw
+// function : VertexDrawMode
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
+
+Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode()
{
- myFaceBoundaryDraw = theIsEnabled;
+ if (!HasOwnVertexDrawMode())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->VertexDrawMode();
+ }
+ // Prs3d_VDM_Isolated is default value for this setting.
+ myVertexDrawMode = Prs3d_VDM_Isolated;
+ }
+ return myVertexDrawMode;
}
// =======================================================================
-// function : IsFaceBoundaryDraw
+// function : DatumAspect
// purpose :
// =======================================================================
-Standard_Boolean Prs3d_Drawer::IsFaceBoundaryDraw () const
+
+const Handle(Prs3d_DatumAspect)& Prs3d_Drawer::DatumAspect()
{
- return myFaceBoundaryDraw;
+ if (!HasOwnDatumAspect())
+ {
+ if (!myLink.IsNull())
+ {
+ return myLink->DatumAspect();
+ }
+ if (myDatumAspect.IsNull())
+ {
+ myDatumAspect = new Prs3d_DatumAspect();
+ }
+ }
+ return myDatumAspect;
}
// =======================================================================
-// function : SetFaceBoundaryAspect
+// function : SetDatumAspect
// purpose :
// =======================================================================
-void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
+
+void Prs3d_Drawer::SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect)
{
- myFaceBoundaryAspect = theAspect;
+ myDatumAspect = theAspect;
+ myHasOwnDatumAspect = !myDatumAspect.IsNull();
}
// =======================================================================
-// function : FaceBoundaryAspect
+// function : SectionAspect
// purpose :
// =======================================================================
-Handle(Prs3d_LineAspect) Prs3d_Drawer::FaceBoundaryAspect ()
+
+const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SectionAspect()
{
- if (myFaceBoundaryAspect.IsNull ())
+ if (!HasOwnSectionAspect())
{
- myFaceBoundaryAspect =
- new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0);
+ if (!myLink.IsNull())
+ {
+ return myLink->SectionAspect();
+ }
+ if (mySectionAspect.IsNull())
+ {
+ mySectionAspect = new Prs3d_LineAspect (Quantity_NOC_ORANGE, Aspect_TOL_SOLID, 1.0);
+ }
}
-
- return myFaceBoundaryAspect;
+ return mySectionAspect;
}
// =======================================================================
-// function : SetTypeOfHLR
-// purpose : set type of HLR algorithm
+// function : SetSectionAspect
+// purpose :
// =======================================================================
-void Prs3d_Drawer::SetTypeOfHLR ( const Prs3d_TypeOfHLR theTypeOfHLR)
+
+void Prs3d_Drawer::SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
- myTypeOfHLR = theTypeOfHLR;
+ mySectionAspect = theAspect;
+ myHasOwnSectionAspect = !mySectionAspect.IsNull();
}
// =======================================================================
-// function : TypeOfHLR
-// purpose : gets type of HLR algorithm
+// function : SetSectionAspect
+// purpose :
// =======================================================================
-Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR ( ) const
+
+void Prs3d_Drawer::ClearLocalAttributes()
{
- return myTypeOfHLR;
+ if (myLink.IsNull())
+ {
+ return;
+ }
+
+ myUIsoAspect.Nullify();
+ myVIsoAspect.Nullify();
+ myFreeBoundaryAspect.Nullify();
+ myUnFreeBoundaryAspect.Nullify();
+ myFaceBoundaryAspect.Nullify();
+ myWireAspect.Nullify();
+ myLineAspect.Nullify();
+ myTextAspect.Nullify();
+ myShadingAspect.Nullify();
+ myPointAspect.Nullify();
+ myPlaneAspect.Nullify();
+ myArrowAspect.Nullify();
+ myHiddenLineAspect.Nullify();
+ mySeenLineAspect.Nullify();
+ myVectorAspect .Nullify();
+ myDatumAspect.Nullify();
+ myDimensionAspect.Nullify();
+ mySectionAspect.Nullify();
+
+ myHasOwnUIsoAspect = Standard_False;
+ myHasOwnVIsoAspect = Standard_False;
+ myHasOwnWireAspect = Standard_False;
+ myHasOwnPointAspect = Standard_False;
+ myHasOwnLineAspect = Standard_False;
+ myHasOwnTextAspect = Standard_False;
+ myHasOwnShadingAspect = Standard_False;
+ myHasOwnPlaneAspect = Standard_False;
+ myHasOwnSeenLineAspect = Standard_False;
+ myHasOwnArrowAspect = Standard_False;
+ myHasOwnHiddenLineAspect = Standard_False;
+ myHasOwnVectorAspect = Standard_False;
+ myHasOwnDatumAspect = Standard_False;
+ myHasOwnSectionAspect = Standard_False;
+ myHasOwnFreeBoundaryAspect = Standard_False;
+ myHasOwnUnFreeBoundaryAspect = Standard_False;
+ myHasOwnFaceBoundaryAspect = Standard_False;
+ myHasOwnDimensionAspect = Standard_False;
+
+ myHasOwnNbPoints = Standard_False;
+ myHasOwnMaximalParameterValue = Standard_False;
+ myHasOwnTypeOfDeflection = Standard_False;
+ myHasOwnChordialDeviation = Standard_False;
+ myHasOwnDeviationCoefficient = Standard_False;
+ myHasOwnHLRDeviationCoefficient = Standard_False;
+ myHasOwnDeviationAngle = Standard_False;
+ myHasOwnHLRDeviationAngle = Standard_False;
+ myHasOwnIsoOnPlane = Standard_False;
+ myHasOwnWireDraw = Standard_False;
+ myHasOwnShadingAspectGlobal = Standard_False;
+ myHasOwnLineArrowDraw = Standard_False;
+ myHasOwnDrawHiddenLine = Standard_False;
+ myHasOwnFreeBoundaryDraw = Standard_False;
+ myHasOwnUnFreeBoundaryDraw = Standard_False;
+ myHasOwnFaceBoundaryDraw = Standard_False;
+ myHasOwnDimLengthModelUnits = Standard_False;
+ myHasOwnDimLengthDisplayUnits = Standard_False;
+ myHasOwnDimAngleModelUnits = Standard_False;
+ myHasOwnDimAngleDisplayUnits = Standard_False;
+
+ myVertexDrawMode = Prs3d_VDM_Inherited;
+ myTypeOfHLR = Prs3d_TOH_NotSet;
}
--- /dev/null
+// 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
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
return 0;
}
-#include <AIS_Drawer.hxx>
#include <Graphic3d_MaterialAspect.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_ShadingAspect.hxx>
//=======================================================================
//function : OCC1174_1
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) anAisIO = new AIS_Shape(aShape);
- Handle(AIS_Shape) ais = new AIS_Shape(sh);
+ Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_RGB);
+ Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_RGB);
- Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
- Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
+ Handle(Prs3d_Drawer) aDrawer = anAisIO->Attributes();
+ Handle(Prs3d_ShadingAspect) aShadingAspect = aDrawer->ShadingAspect();
- Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
+ 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 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 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);
- 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);
+ aDrawer->SetShadingAspect (aShadingAspect);
- AISContext->Display(ais,1,0);
+ 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;
#include <BRepPrimAPI_MakeSphere.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
-#include <AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_ShadingAspect.hxx>
//#include <AcisData_AcisModel.hxx>
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();
#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>
#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)
Selection from SelectMgr,
SequenceOfSelection from SelectMgr,
TypeOfPresentation3d from PrsMgr,
+ Drawer from Prs3d,
Presentation from Prs3d,
PresentationManager from PrsMgr,
PresentationManager3d from PrsMgr,
---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;
#include <SelectBasics_EntityOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
+#include <Prs3d_Drawer.hxx>
#include <TopLoc_Location.hxx>
#include <gp_Pnt.hxx>
// 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)
+{}
//==================================================
}
}
}
+
+//=======================================================================
+//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;
+}
+
CurrentSelection() const
{return myselections(mycurrent);}
+inline const Handle(Prs3d_Drawer)& SelectMgr_SelectableObject::
+Attributes() const
+{return myDrawer;}
(theVolume == StdPrs_Volume_Closed ? Standard_True : Standard_False));
}
- if (theDrawer->IsFaceBoundaryDraw())
+ if (theDrawer->FaceBoundaryDraw())
{
computeFaceBoundaries (theShape, thePrs, theDrawer);
}
TDataXtd,
Geom,
TopoDS,
- gp
+ gp,
+ Prs3d
is
NameOfColor from Quantity,
PlaneAngle from Quantity,
NameOfMaterial from Graphic3d,
- Drawer from AIS
+ Drawer from Prs3d
is
GetID (myclass) returns GUID from Standard;
#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>
#include <Standard_GUID.hxx>
#include <TDataStd_Real.hxx>
#include <TDataXtd_Position.hxx>
-#include <AIS_Drawer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_Relation.hxx>
#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>
#include <Standard_ErrorHandler.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
+#include <Prs3d_Drawer.hxx>
static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota
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())
Standard_Real val1;
TCollection_ExtendedString txt;
Handle(AIS_LengthDimension) ais;
- //Handle(AIS_Drawer) aDrawer;
+ //Handle(Prs3d_Drawer) aDrawer;
if (nbgeom == 1)
{
#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>
//#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>
#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>
#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>
#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>
#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
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();
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),
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
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;
}
}
Standard_Integer anArgIter = 1;
+ Standard_Boolean isDefaults = Standard_False;
NCollection_Sequence<TCollection_AsciiString> aNames;
for (; anArgIter < theArgNb; ++anArgIter)
{
}
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();
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";
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;
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
{
{
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);
{
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())
{
{
aCtx->Display (aPrs, Standard_False);
}
+ if (toRedisplay)
+ {
+ aCtx->Redisplay (aPrs, Standard_False);
+ }
else if (!aColoredPrs.IsNull())
{
aColoredPrs->Redisplay();
__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",
#include <Standard_Real.hxx>
#include <AIS_Circle.hxx>
-#include <AIS_Drawer.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepExtrema_ExtPC.hxx>
#include <BRepExtrema_ExtPF.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_VertexDrawMode.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PointAspect.hxx>
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();
continue;
}
anObject = new AIS_Shape (aTDShape);
+ aContext->Load (anObject);
anObject->SetColor (ViewerTest::GetColorFromName (aColorName));
}
#include <ViewerTest.hxx>
-#include <AIS_Drawer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Draw.hxx>
#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>
#include <OpenGl_GlCore20.hxx>
#include <AIS_Shape.hxx>
-#include <AIS_Drawer.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <NCollection_DataMap.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Prs3d_ShadingAspect.hxx>
+#include <Prs3d_Drawer.hxx>
#ifdef WNT
#undef DrawText
#include <gp_Pnt.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
-#include <Handle_AIS_Drawer.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
//function : SetColors
//purpose :
//=======================================================================
-void XCAFPrs_AISObject::SetColors (const Handle(AIS_Drawer)& theDrawer,
- const Quantity_Color& theColorCurv,
- const Quantity_Color& theColorSurf)
+void XCAFPrs_AISObject::SetColors (const Handle(Prs3d_Drawer)& theDrawer,
+ const Quantity_Color& theColorCurv,
+ const Quantity_Color& theColorSurf)
{
- 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->HasUIsoAspect())
+ if (!theDrawer->HasOwnUIsoAspect())
{
theDrawer->SetUIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1));
- *theDrawer->UIsoAspect()->Aspect() = *theDrawer->Link()->UIsoAspect()->Aspect();
- theDrawer->UIsoAspect()->SetNumber (theDrawer->Link()->UIsoAspect()->Number());
+ if (theDrawer->HasLink())
+ {
+ *theDrawer->UIsoAspect()->Aspect() = *theDrawer->Link()->UIsoAspect()->Aspect();
+ theDrawer->UIsoAspect()->SetNumber (theDrawer->Link()->UIsoAspect()->Number());
+ }
}
- if (!theDrawer->HasVIsoAspect())
+ if (!theDrawer->HasOwnVIsoAspect())
{
theDrawer->SetVIsoAspect (new Prs3d_IsoAspect (Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5, 1));
- *theDrawer->VIsoAspect()->Aspect() = *theDrawer->Link()->VIsoAspect()->Aspect();
- theDrawer->VIsoAspect()->SetNumber (theDrawer->Link()->VIsoAspect()->Number());
+ if (theDrawer->HasLink())
+ {
+ *theDrawer->VIsoAspect()->Aspect() = *theDrawer->Link()->VIsoAspect()->Aspect();
+ theDrawer->VIsoAspect()->SetNumber (theDrawer->Link()->VIsoAspect()->Number());
+ }
}
- if (!theDrawer->HasFreeBoundaryAspect())
+ if (!theDrawer->HasOwnFreeBoundaryAspect())
{
theDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
- *theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
+ if (theDrawer->HasLink())
+ {
+ *theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect();
+ }
}
- if (!theDrawer->HasUnFreeBoundaryAspect())
+ if (!theDrawer->HasOwnUnFreeBoundaryAspect())
{
theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
- *theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
+ if (theDrawer->HasLink())
+ {
+ *theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect();
+ }
}
theDrawer->UnFreeBoundaryAspect()->SetColor (theColorCurv);
const Standard_Integer theMode);
//! Set colors to drawer
- Standard_EXPORT void SetColors (const Handle(AIS_Drawer)& theDrawer,
- const Quantity_Color& theColorCurv,
- const Quantity_Color& theColorSurf);
+ Standard_EXPORT void SetColors (const Handle(Prs3d_Drawer)& theDrawer,
+ const Quantity_Color& theColorCurv,
+ const Quantity_Color& theColorSurf);
//! Fills out a default style object which is used when styles are
//! not explicitly defined in the document.
#include <TColStd_HArray1OfReal.hxx>
#include <AIS_InteractiveObject.hxx>
-#include <AIS_Drawer.hxx>
#include <Aspect_TypeOfLine.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <TDocStd_Owner.hxx>
#include <Geom_Axis2Placement.hxx>
}
// get drawer
- const Handle(AIS_Drawer)& aDrawer = anInteractive->Attributes ();
+ const Handle(Prs3d_Drawer)& aDrawer = anInteractive->Attributes ();
// default attributes
Quantity_Parameter aRed = 0.0;
--- /dev/null
+puts "============"
+puts "CR25773"
+puts "Check that properties of object can be applied to it (set to its drawer)"
+puts "============"
+puts ""
+
+vinit View1
+vclear
+
+vaspects -defaults -setfreeboundarycolor 0 0 1
+
+pcone c 0 5 10
+explode c F
+vdisplay c_1; vfit
+
+set x 80
+set y 103
+checkcolor $x $y 0 0 1
+
+vaspects c_1 -freeboundary off
+checkcolor $x $y 0 0 0
+
+vaspects c_1 -freeboundary on -setfreeboundarycolor 1 0 0 -setfreeboundarywidth 2
+checkcolor $x $y 1 0 0
+
+set only_screen 1