mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0025773: Visualization - remove AIS_Drawer class and transfer its Link() logic to Prs3d_Drawer
This commit is contained in:
@@ -328,8 +328,6 @@ is
|
||||
imported ColoredShape;
|
||||
imported TexturedShape;
|
||||
|
||||
class Drawer;
|
||||
|
||||
class InteractiveContext;
|
||||
|
||||
class GraphicTool;
|
||||
@@ -681,7 +679,7 @@ is
|
||||
|
||||
|
||||
ComputeProjEdgePresentation(aPres : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
anEdge : Edge from TopoDS;
|
||||
ProjCurve: Curve from Geom;
|
||||
FirstP : Pnt from gp;
|
||||
@@ -692,7 +690,7 @@ is
|
||||
aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT);
|
||||
|
||||
ComputeProjVertexPresentation(aPres : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
aVertex : Vertex from TopoDS;
|
||||
ProjPoint: Pnt from gp;
|
||||
aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
|
||||
|
@@ -1390,18 +1390,18 @@ gp_Pnt AIS::NearestApex(const gp_Elips & elips,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const TopoDS_Edge& anEdge,
|
||||
const Handle( Geom_Curve )& ProjCurve,
|
||||
const gp_Pnt& FirstP,
|
||||
const gp_Pnt& LastP,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfLine aProjTOL,
|
||||
const Aspect_TypeOfLine aCallTOL )
|
||||
void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Handle(Prs3d_Drawer)& aDrawer,
|
||||
const TopoDS_Edge& anEdge,
|
||||
const Handle(Geom_Curve)& ProjCurve,
|
||||
const gp_Pnt& FirstP,
|
||||
const gp_Pnt& LastP,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfLine aProjTOL,
|
||||
const Aspect_TypeOfLine aCallTOL)
|
||||
{
|
||||
if (!aDrawer->HasWireAspect()){
|
||||
if (!aDrawer->HasOwnWireAspect()){
|
||||
aDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aProjTOL,2.));}
|
||||
else {
|
||||
// CLE
|
||||
@@ -1493,16 +1493,16 @@ void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPres
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS::ComputeProjVertexPresentation( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const TopoDS_Vertex& aVertex,
|
||||
const gp_Pnt& ProjPoint,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfMarker aProjTOM,
|
||||
const Aspect_TypeOfLine aCallTOL )
|
||||
void AIS::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const TopoDS_Vertex& aVertex,
|
||||
const gp_Pnt& ProjPoint,
|
||||
const Quantity_NameOfColor aColor,
|
||||
const Standard_Real aWidth,
|
||||
const Aspect_TypeOfMarker aProjTOM,
|
||||
const Aspect_TypeOfLine aCallTOL)
|
||||
{
|
||||
if (!aDrawer->HasPointAspect()){
|
||||
if (!aDrawer->HasOwnPointAspect()){
|
||||
aDrawer->SetPointAspect(new Prs3d_PointAspect(aProjTOM, aColor,1));}
|
||||
else {
|
||||
// CLE
|
||||
@@ -1516,7 +1516,7 @@ void AIS::ComputeProjVertexPresentation( const Handle( Prs3d_Presentation )& aPr
|
||||
// calculate the projection
|
||||
StdPrs_Point::Add(aPresentation, new Geom_CartesianPoint(ProjPoint), aDrawer);
|
||||
|
||||
if (!aDrawer->HasWireAspect()){
|
||||
if (!aDrawer->HasOwnWireAspect()){
|
||||
aDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aCallTOL,2.));}
|
||||
else {
|
||||
// CLE
|
||||
|
@@ -17,7 +17,6 @@
|
||||
#include <AIS_AngleDimension.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <DsgPrs_XYZAxisPresentation.hxx>
|
||||
#include <UnitsAPI.hxx>
|
||||
|
||||
|
@@ -52,7 +52,6 @@
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <ProjLib.hxx>
|
||||
|
@@ -52,7 +52,6 @@
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <ProjLib.hxx>
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include <TopoDS.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <GC_MakeArcOfCircle.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
@@ -128,10 +127,12 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
|
||||
hasOwnColor=Standard_True;
|
||||
myOwnColor=aCol;
|
||||
|
||||
Standard_Real WW = HasWidth()? myOwnWidth:
|
||||
AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
Standard_Real WW = HasWidth() ? myOwnWidth :
|
||||
myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
|
||||
1.;
|
||||
|
||||
if (!myDrawer->HasLineAspect ())
|
||||
if (!myDrawer->HasOwnLineAspect ())
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
else
|
||||
myDrawer->LineAspect()->SetColor(aCol);
|
||||
@@ -147,10 +148,10 @@ void AIS_Circle::SetWidth(const Standard_Real aValue)
|
||||
{
|
||||
myOwnWidth=aValue;
|
||||
|
||||
if (!myDrawer->HasLineAspect ()) {
|
||||
Quantity_Color CC;
|
||||
if (!myDrawer->HasOwnLineAspect ()) {
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
||||
} else
|
||||
myDrawer->LineAspect()->SetWidth(aValue);
|
||||
@@ -169,9 +170,9 @@ void AIS_Circle::UnsetColor()
|
||||
|
||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Quantity_Color CC;
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
myDrawer->LineAspect()->SetColor(CC);
|
||||
myOwnColor = CC;
|
||||
}
|
||||
@@ -187,7 +188,7 @@ void AIS_Circle::UnsetWidth()
|
||||
|
||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Standard_Real WW = AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
|
||||
myDrawer->LineAspect()->SetWidth(WW);
|
||||
myOwnWidth = WW;
|
||||
}
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
@@ -41,8 +42,8 @@
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE (AIS_ColoredDrawer, AIS_Drawer)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredDrawer, AIS_Drawer)
|
||||
IMPLEMENT_STANDARD_HANDLE (AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE (AIS_ColoredShape, AIS_Shape)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_ColoredShape, AIS_Shape)
|
||||
@@ -203,15 +204,15 @@ void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aDrawer->HasShadingAspect())
|
||||
if (aDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetColor (theColor, myCurrentFacingModel);
|
||||
}
|
||||
if (aDrawer->HasLineAspect())
|
||||
if (aDrawer->HasOwnLineAspect())
|
||||
{
|
||||
aDrawer->LineAspect()->SetColor (theColor);
|
||||
}
|
||||
if (aDrawer->HasWireAspect())
|
||||
if (aDrawer->HasOwnWireAspect())
|
||||
{
|
||||
aDrawer->WireAspect()->SetColor (theColor);
|
||||
}
|
||||
@@ -237,11 +238,11 @@ void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aDrawer->HasLineAspect())
|
||||
if (aDrawer->HasOwnLineAspect())
|
||||
{
|
||||
aDrawer->LineAspect()->SetWidth (theLineWidth);
|
||||
}
|
||||
if (aDrawer->HasWireAspect())
|
||||
if (aDrawer->HasOwnWireAspect())
|
||||
{
|
||||
aDrawer->WireAspect()->SetWidth (theLineWidth);
|
||||
}
|
||||
@@ -261,8 +262,8 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
|
||||
LoadRecomputable (AIS_Shaded);
|
||||
for (DataMapOfShapeColor::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_Drawer)& aDrawer = anIter.Value();
|
||||
if (aDrawer->HasShadingAspect())
|
||||
const Handle(Prs3d_Drawer)& aDrawer = anIter.Value();
|
||||
if (aDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
aDrawer->ShadingAspect()->SetTransparency (theValue, myCurrentFacingModel);
|
||||
}
|
||||
@@ -284,7 +285,7 @@ void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
{
|
||||
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
|
||||
//if (aDrawer->HasOwnMaterial()) continue;
|
||||
if (aDrawer->HasShadingAspect())
|
||||
if (aDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), Standard_False); // aDrawer->IsTransparent()
|
||||
}
|
||||
@@ -377,7 +378,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
||||
{
|
||||
const TopoDS_Shape& aShapeKey = aMapIter.Key(); // key shape with detailed color or a base shape
|
||||
const TopoDS_Compound& aShapeDraw = aMapIter.Value(); // compound of subshapes with <aShType> type
|
||||
Handle(AIS_Drawer) aDrawer;
|
||||
Handle(Prs3d_Drawer) aDrawer;
|
||||
if (myShapeColors.Find (aShapeKey, aCustomDrawer))
|
||||
{
|
||||
aDrawer = aCustomDrawer;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#ifndef _AIS_ColoredShape_HeaderFile
|
||||
#define _AIS_ColoredShape_HeaderFile
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
@@ -26,11 +26,11 @@
|
||||
#include <StdPrs_Volume.hxx>
|
||||
|
||||
//! Customizable properties.
|
||||
class AIS_ColoredDrawer : public AIS_Drawer
|
||||
class AIS_ColoredDrawer : public Prs3d_Drawer
|
||||
{
|
||||
public:
|
||||
|
||||
AIS_ColoredDrawer (const Handle(AIS_Drawer)& theLink)
|
||||
AIS_ColoredDrawer (const Handle(Prs3d_Drawer)& theLink)
|
||||
: myIsHidden (Standard_False),
|
||||
myHasOwnColor (Standard_False),
|
||||
myHasOwnWidth (Standard_False)
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_ColoredDrawer, AIS_Drawer)
|
||||
DEFINE_STANDARD_HANDLE(AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
|
||||
//! Presentation of the shape with customizable sub-shapes properties.
|
||||
class AIS_ColoredShape : public AIS_Shape
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
#include <StdPrs_WFDeflectionShape.hxx>
|
||||
|
@@ -23,12 +23,12 @@
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <AIS_KindOfSurface.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_DimensionUnits.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
|
@@ -1,682 +0,0 @@
|
||||
-- Created on: 1992-09-18
|
||||
-- Created by: Odile Olivier
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Drawer from AIS inherits Drawer from Prs3d
|
||||
|
||||
---Purpose:
|
||||
-- A framework to manage display attributes of interactive objects.
|
||||
-- An interactive object can have a certain number of
|
||||
-- display attributes specific to it. These include
|
||||
-- visualization mode, color, material
|
||||
-- and so on. To deal with this information, the
|
||||
-- interactive context has a Drawer attribute manager
|
||||
-- which is valid by default for the objects it
|
||||
-- controls. When an interactive object is visualized, the
|
||||
-- required graphic display attributes are first taken from
|
||||
-- its own Drawer if it has the ones required, or from the
|
||||
-- context drawer for those it does not have them.
|
||||
-- The set of display attributes of an interactive object is
|
||||
-- stocked in an AIS_Drawer, which is, in fact, a
|
||||
-- Prs3d_Drawer with the possibility of a link to another
|
||||
-- display attribute manager. This drawer then manages
|
||||
-- the stocked graphic display attributes by specifying
|
||||
-- how the presentation algorithms compute the
|
||||
-- presentation of a specific kind of object. These
|
||||
-- factors involved include color, width and type of line,
|
||||
-- and maximal chordal deviation. The Drawer includes
|
||||
-- instances of the aspect classes providing the default
|
||||
-- values for them.
|
||||
-- Prs3d_Drawer completes AIS_Drawer by adding
|
||||
-- functions for setting deviation angle and deviation
|
||||
-- coefficient in presentations using hidden line removal.
|
||||
|
||||
uses
|
||||
Drawer from Prs3d,
|
||||
DatumAspect from Prs3d,
|
||||
LineAspect from Prs3d,
|
||||
TextAspect from Prs3d,
|
||||
PointAspect from Prs3d,
|
||||
ShadingAspect from Prs3d,
|
||||
IsoAspect from Prs3d,
|
||||
DimensionAspect from Prs3d,
|
||||
PlaneAspect from Prs3d,
|
||||
ArrowAspect from Prs3d,
|
||||
TypeOfDeflection from Aspect,
|
||||
NameOfColor from Quantity,
|
||||
PlaneAngle from Quantity,
|
||||
Length from Quantity,
|
||||
DimensionUnits from Prs3d,
|
||||
VertexDrawMode from Prs3d,
|
||||
AsciiString from TCollection,
|
||||
TypeOfHLR from Prs3d,
|
||||
Ax2 from gp
|
||||
|
||||
is
|
||||
Create returns Drawer from AIS;
|
||||
---Purpose:
|
||||
-- Constructs an empty attribute management framework.
|
||||
TypeOfDeflection(me) returns TypeOfDeflection from Aspect
|
||||
is redefined static;
|
||||
--- Purpose:
|
||||
-- Returns the type of chordal deflection: relative to the
|
||||
-- size of the object or absolute.
|
||||
|
||||
MaximalChordialDeviation (me) returns Length from Quantity
|
||||
---Purpose: Returns the maximal chordal deviation. The default
|
||||
-- value is 0.1. Drawings of curves or patches are
|
||||
-- made with respect to an absolute maximal chordal deviation.
|
||||
is redefined static;
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
SetDeviationCoefficient(me: mutable) ;
|
||||
---Purpose: Sets the hasOwnDeviationCoefficient flag to Standard_False
|
||||
---C++: inline
|
||||
|
||||
SetHLRDeviationCoefficient(me: mutable) ;
|
||||
---Purpose: Sets the deviation coefficient aCoefficient for
|
||||
-- removal of hidden lines created by different
|
||||
-- viewpoints in different presentations. The Default value is 0.02.
|
||||
---C++: inline
|
||||
|
||||
SetDeviationAngle(me: mutable) ;
|
||||
---Purpose: Sets the hasOwnDeviationAngle flag to Standard_False
|
||||
---C++: inline
|
||||
|
||||
SetHLRAngle(me: mutable) ;
|
||||
---Purpose: Sets the angle of maximum chordal deviation for
|
||||
-- removal of hidden lines created by different viewpoints
|
||||
-- in different presentations. The default value is 20*PI/180.
|
||||
---C++: inline
|
||||
|
||||
SetDeviationCoefficient(me: mutable; aCoefficient: Real from Standard )
|
||||
---Purpose: Sets the hasOwnDeviationCoefficient flag to Standard_True,
|
||||
-- sets myOwnDeviationCoefficient and myPreviousDeviationCoefficient
|
||||
is redefined static;
|
||||
|
||||
SetHLRDeviationCoefficient(me: mutable; aCoefficient: Real from Standard )
|
||||
---Purpose: Sets the hasOwnHLRDeviationCoefficient flag to Standard_True,
|
||||
-- sets myOwnHLRDeviationCoefficient and myPreviousHLRDeviationCoefficient
|
||||
is redefined static;
|
||||
|
||||
SetDeviationAngle(me: mutable; anAngle: Real from Standard ) is redefined ;
|
||||
---Purpose: Sets the hasOwnDeviationAngle flag to Standard_True,
|
||||
-- sets myOwnDeviationAngle and myPreviousDeviationAngle
|
||||
|
||||
SetHLRAngle(me: mutable; anAngle: Real from Standard )
|
||||
---Purpose: Sets the hasOwnHLRDeviationAngle flag to Standard_True,
|
||||
-- sets myOwnHLRDeviationAngle and myPreviousHLRDeviationAngle
|
||||
is redefined static;
|
||||
|
||||
SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d)
|
||||
is redefined;
|
||||
---Purpose: Sets the type of HLR algorithm
|
||||
-- used by drawer's interactive objects
|
||||
---C++: inline
|
||||
|
||||
TypeOfHLR(me) returns TypeOfHLR from Prs3d
|
||||
is redefined;
|
||||
---Purpose: Returns the type of HLR algorithm currently in use.
|
||||
---C++: inline
|
||||
|
||||
DeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: Drawings of curves or patches are made with respect
|
||||
-- to a maximal chordal deviation. A Deviation coefficient
|
||||
-- is used in the shading display mode. The shape is
|
||||
-- seen decomposed into triangles. These are used to
|
||||
-- calculate reflection of light from the surface of the
|
||||
-- object. The triangles are formed from chords of the
|
||||
-- curves in the shape. The deviation coefficient gives
|
||||
-- the highest value of the angle with which a chord can
|
||||
-- deviate from a tangent to a curve. If this limit is
|
||||
-- reached, a new triangle is begun.
|
||||
-- This deviation is absolute and is set through the
|
||||
-- method: SetMaximalChordialDeviation. The default value is 0.001.
|
||||
-- In drawing shapes, however, you are allowed to ask
|
||||
-- for a relative deviation. This deviation will be:
|
||||
-- SizeOfObject * DeviationCoefficient.
|
||||
is redefined static;
|
||||
|
||||
HLRDeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: Returns the real number value of the HLR deviation
|
||||
-- coefficient in this framework, if the flag
|
||||
-- hasOwnHLRDeviationCoefficient is true.
|
||||
-- If hasOwnHLRDeviationCoefficient is false, the
|
||||
-- shape's HLR deviation coefficient is used.
|
||||
-- A Deviation coefficient is used in the shading display
|
||||
-- mode. The shape is seen decomposed into triangles.
|
||||
-- These are used to calculate reflection of light from the
|
||||
-- surface of the object.
|
||||
-- The triangles are formed from chords of the curves in
|
||||
-- the shape. The deviation coefficient give the highest
|
||||
-- value of the angle with which a chord can deviate
|
||||
-- from a tangent to a curve. If this limit is reached, a
|
||||
-- new triangle is begun.
|
||||
-- To find the hidden lines, hidden line display mode
|
||||
-- entails recalculation of the view at each different
|
||||
-- projector perspective.
|
||||
-- Since hidden lines entail calculations of more than
|
||||
-- usual complexity to decompose them into these
|
||||
-- triangles, a deviation coefficient allowing greater
|
||||
-- tolerance is used. This increases efficiency in calculation.
|
||||
-- The Default value is 0.02.
|
||||
is redefined static;
|
||||
|
||||
|
||||
DeviationAngle(me) returns Real from Standard
|
||||
---Purpose: Returns myOwnDeviationAngle if hasOwnDeviationAngle is True
|
||||
-- else gets myDeviationAngle field from Prs3d_Drawer
|
||||
is redefined;
|
||||
|
||||
HLRAngle(me) returns Real from Standard
|
||||
---Purpose: Returns the real number value of the deviation angle
|
||||
-- in hidden line removal views. The default value is 20*PI/180.
|
||||
is redefined static;
|
||||
|
||||
|
||||
PreviousDeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: Saves the previous value used for the chordal
|
||||
-- deviation coefficient. The default value is 0.1.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
PreviousHLRDeviationCoefficient(me) returns Real from Standard
|
||||
---Purpose: returns myPreviousHLRDeviationCoefficient
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
PreviousDeviationAngle(me) returns Real from Standard
|
||||
---Purpose: returns myPreviousDeviationAngle
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
PreviousHLRDeviationAngle(me) returns Real from Standard
|
||||
---Purpose: returns myPreviousHLRDeviationAngle
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
IsOwnDeviationCoefficient(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a local setting for deviation
|
||||
-- coefficient in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
IsOwnHLRDeviationCoefficient(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a setting for HLR deviation
|
||||
-- coefficient in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
IsOwnDeviationAngle(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a local setting for deviation
|
||||
-- angle in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
IsOwnHLRDeviationAngle(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the there is a setting for HLR deviation
|
||||
-- angle in this framework for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
Discretisation(me) returns Integer from Standard
|
||||
is redefined static;
|
||||
---Purpose: Draws algorithms using discretisation, a default
|
||||
-- number of points has been set to 17. You can use the
|
||||
-- method Prs3d_Drawer_SetDiscretisation to change this value.
|
||||
|
||||
MaximalParameterValue(me) returns Real from Standard
|
||||
is redefined static;
|
||||
---Purpose:
|
||||
-- Sets the maximum value allowed for the first and last
|
||||
-- parameters of an infinite curve. By default, this value is 500000.
|
||||
|
||||
IsoOnPlane(me) returns Boolean from Standard
|
||||
---Purpose: returns True if the drawing of isos on planes is enabled.
|
||||
is redefined static;
|
||||
|
||||
|
||||
--
|
||||
-- Attributes for the U Isoparametric lines of patches.
|
||||
--
|
||||
UIsoAspect (me:mutable) returns IsoAspect from Prs3d
|
||||
---Purpose: Defines the attributes which are used when drawing an
|
||||
-- U isoparametric curve of a face. Defines the number
|
||||
-- of U isoparametric curves to be drawn for a single face.
|
||||
-- The LineAspect for U isoparametric lines can be edited
|
||||
-- (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
-- The default values are:
|
||||
-- COLOR : Quantity_NOC_GRAY75
|
||||
-- TYPE OF LINE: Aspect_TOL_SOLID
|
||||
-- WIDTH : 0.5
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFDeflectionSurface
|
||||
-- Prs3d_WFDeflectionRestrictedFace
|
||||
|
||||
|
||||
is redefined static;
|
||||
|
||||
HasUIsoAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a UIso aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
-- Attributes for the V Isoparametric line of patches.
|
||||
|
||||
|
||||
VIsoAspect (me:mutable) returns IsoAspect from Prs3d
|
||||
---Purpose: Defines the attributes which are used when drawing an
|
||||
-- V isoparametric curve of a face. Defines the number
|
||||
-- of V isoparametric curves to be drawn for a single face.
|
||||
-- The LineAspect for V isoparametric lines can be edited
|
||||
-- (methods SetColor, SetTypeOfLine, SetWidth, SetNumber)
|
||||
-- The default values are:
|
||||
-- COLOR : Quantity_NOC_GRAY82
|
||||
-- TYPE OF LINE: Aspect_TOL_SOLID
|
||||
-- WIDTH : 0.5
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFDeflectionSurface
|
||||
-- Prs3d_WFDeflectionRestrictedFace
|
||||
is redefined static;
|
||||
|
||||
HasVIsoAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a VIso aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
-- Attributes for the free boundaries
|
||||
|
||||
FreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_FreeBoundaryAspect. Stores the
|
||||
-- values for presentation of free boundaries, in other
|
||||
-- words, boundaries which are not shared . The
|
||||
-- LineAspect for the free boundaries can be edited. The
|
||||
-- default values are: Color: Quantity_NOC_GREEN
|
||||
-- Type of line: Aspect_TOL_SOLID Width: 1.
|
||||
-- These attributes are used by Prs3d_WFShape.
|
||||
is redefined static;
|
||||
|
||||
HasFreeBoundaryAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a free boundary aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
FreeBoundaryDraw(me) returns Boolean from Standard
|
||||
---Purpose: returns True if the drawing of the free boundaries is enabled.
|
||||
is redefined static;
|
||||
|
||||
|
||||
-- Attributes for the wires
|
||||
|
||||
WireAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_WireAspect.
|
||||
-- This method provides wire aspect settings.
|
||||
-- The LineAspect for wires can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_RED
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFShape
|
||||
is redefined static;
|
||||
|
||||
HasLineAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Interactive Object has a line
|
||||
-- visualization aspect.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
HasWireAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a wire aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
WireDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns a link with Prs3d_Drawer_WireDraw. This
|
||||
-- method returns true if drawing of wires is enabled.
|
||||
-- The default setting is true.
|
||||
is redefined static;
|
||||
|
||||
|
||||
-- Attributes for the unfree boundaries
|
||||
|
||||
UnFreeBoundaryAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_UnFreeBoundaryAspect, which
|
||||
-- provides settings for shared boundary line aspects.
|
||||
-- The LineAspect for shared boundaries can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFShape
|
||||
is redefined static;
|
||||
|
||||
HasUnFreeBoundaryAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has an unfree boundary aspect setting active.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
UnFreeBoundaryDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if the drawing of the shared boundaries
|
||||
-- is enabled. True is the default setting.
|
||||
is redefined static;
|
||||
|
||||
|
||||
--
|
||||
-- Attributes for the lines.
|
||||
--
|
||||
|
||||
LineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_LineAspect,
|
||||
-- which provides settings for line aspects. These
|
||||
-- settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_Curve
|
||||
-- Prs3d_Line
|
||||
-- Prs3d_HLRShape
|
||||
|
||||
is redefined static;
|
||||
|
||||
|
||||
|
||||
HasTextAspect(me) returns Boolean from Standard
|
||||
is static;
|
||||
---C++: inline
|
||||
TextAspect(me:mutable) returns TextAspect from Prs3d
|
||||
--
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
is redefined static;
|
||||
|
||||
LineArrowDraw(me) returns Boolean from Standard
|
||||
---Purpose: Returns True if the drawing of an arrow at the end of
|
||||
-- each line is enabled. The default setting is False.
|
||||
is redefined static;
|
||||
|
||||
ArrowAspect(me:mutable) returns ArrowAspect from Prs3d
|
||||
is redefined static;
|
||||
|
||||
|
||||
-- --
|
||||
-- Attributes for the points
|
||||
--
|
||||
PointAspect(me:mutable) returns PointAspect from Prs3d
|
||||
---Purpose: Returns the point aspect setting. The default values
|
||||
-- are: Color: Quantity_NOC_YELLOW
|
||||
-- Type of marker: Aspect_TOM_PLUS
|
||||
-- Scale: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_Point
|
||||
is redefined static;
|
||||
|
||||
HasPointAspect (me) returns Boolean from Standard
|
||||
---Purpose: Returns true if the Drawer has a point aspect setting active.
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
SetVertexDrawMode(me: mutable; theMode: VertexDrawMode from Prs3d)
|
||||
---Purpose: Sets the mode of visualization of vertices by AIS_Shape and helper algorithms.
|
||||
-- By default, only isolated vertices not belonging to any face are drawn,
|
||||
-- that corresponds to <b>Prs3d_VDM_Isolated</b> mode.
|
||||
-- Switching to <b>Prs3d_VDM_Isolated</b> mode makes all shape's vertices visible.
|
||||
-- To inherit this parameter from the global drawer instance ("the link") when it is present,
|
||||
-- <b>Prs3d_VDM_Inherited</b> value should be used.
|
||||
is redefined static;
|
||||
|
||||
VertexDrawMode(me) returns VertexDrawMode from Prs3d
|
||||
---Purpose: Returns the current mode of visualization of vertices of a TopoDS_Shape instance.
|
||||
is redefined static;
|
||||
|
||||
IsOwnVertexDrawMode(me) returns Boolean from Standard;
|
||||
---Purpose: Returns true if the vertex draw mode is not equal to <b>Prs3d_VDM_Inherited</b>.
|
||||
-- This means that individual vertex draw mode value (i.e. not inherited from the global
|
||||
-- drawer) is used for a specific interactive object.
|
||||
---C++: inline
|
||||
|
||||
-- Attributes for the faces:
|
||||
--
|
||||
ShadingAspect (me:mutable) returns ShadingAspect from Prs3d
|
||||
---Purpose:
|
||||
-- Returns a link with Prs3d_Drawer_ShadingAspect,
|
||||
-- which provides settings for shading aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Material: Graphic3d_NOM_BRASS
|
||||
-- hading aspect is obtained through decomposition of
|
||||
-- 3D faces into triangles, each side of each triangle
|
||||
-- being a chord of the corresponding curved edge in
|
||||
-- the face. Reflection of light in each projector
|
||||
-- perspective is then calculated for each of the
|
||||
-- resultant triangular planes.
|
||||
is redefined static;
|
||||
|
||||
HasShadingAspect (me) returns Boolean from Standard
|
||||
---C++: inline
|
||||
---Purpose: Returns True if the Drawer has shading aspect active.
|
||||
is static;
|
||||
|
||||
ShadingAspectGlobal(me) returns Boolean from Standard
|
||||
is redefined static;
|
||||
---Purpose: Provides the attributes for hidden line removal.
|
||||
|
||||
|
||||
DrawHiddenLine(me) returns Boolean from Standard
|
||||
---Purpose: Returns Standard_True if the hidden lines are to be drawn.
|
||||
-- By default the hidden lines are not drawn.
|
||||
is redefined static;
|
||||
|
||||
HiddenLineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_HiddenLineAspect, which provides
|
||||
-- settings for hidden line aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_DASH
|
||||
-- Width: 1.
|
||||
is redefined static;
|
||||
|
||||
|
||||
SeenLineAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with
|
||||
-- Prs3d_Drawer_SeenLineAspect, which provides
|
||||
-- settings for seen line aspects.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_YELLOW
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
is redefined static;
|
||||
|
||||
|
||||
HasPlaneAspect(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
PlaneAspect(me:mutable) returns PlaneAspect from Prs3d
|
||||
is redefined static;
|
||||
---Purpose:
|
||||
-- Returns a link with Prs3d_Drawer_PlaneAspect.
|
||||
-- This method provides settings for the appearance of planes.
|
||||
|
||||
|
||||
VectorAspect(me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_VectorAspect,
|
||||
-- which provides settings for the appearance of vectors.
|
||||
-- These settings can be edited. The default values are:
|
||||
-- Color: Quantity_NOC_SKYBLUE
|
||||
-- Type of line: Aspect_TOL_SOLID Width: 1.
|
||||
is redefined static;
|
||||
|
||||
SetFaceBoundaryDraw (me : mutable;
|
||||
theIsEnabled : Boolean from Standard)
|
||||
is redefined static;
|
||||
---Purpose: Enables or disables drawing of face boundaries for shading presentations.
|
||||
-- The method sets drawing flag owned by the drawer that will be used during
|
||||
-- visualization instead of the one set in link.
|
||||
-- theIsEnabled is a boolean flag indicating whether the face boundaries should be
|
||||
-- drawn or not.
|
||||
|
||||
IsFaceBoundaryDraw (me) returns Boolean from Standard
|
||||
is redefined static;
|
||||
---Purpose: Checks whether the drawing of face boundaries is enabled or not.
|
||||
|
||||
SetFaceBoundaryAspect (me : mutable;
|
||||
theAspect : LineAspect from Prs3d)
|
||||
is redefined static;
|
||||
---Purpose: Sets line aspect for face boundaries.
|
||||
-- The method sets line aspect owned by the drawer that will be used during
|
||||
-- visualization instead of the one set in link.
|
||||
-- theAspect is the line aspect that determines the look of the face boundaries.
|
||||
|
||||
FaceBoundaryAspect (me : mutable) returns LineAspect from Prs3d
|
||||
is redefined static;
|
||||
---Purpose: Returns line aspect of face boundaries.
|
||||
|
||||
IsOwnFaceBoundaryDraw (me) returns Boolean from Standard
|
||||
is static;
|
||||
---Purpose: Returns true if the drawer has its own attribute for
|
||||
-- "draw face boundaries" flag that overrides the one in the link.
|
||||
---C++: inline
|
||||
|
||||
IsOwnFaceBoundaryAspect (me) returns Boolean from Standard
|
||||
is static;
|
||||
---Purpose: Returns true if the drawer has its own attribute for
|
||||
-- face boundaries aspect that overrides the one in the link.
|
||||
---C++: inline
|
||||
--
|
||||
-- Attributes for the presentation of a Datum.
|
||||
--
|
||||
|
||||
HasDatumAspect(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
DatumAspect(me:mutable) returns DatumAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_DatumAspect,
|
||||
-- which provides settings for the appearance of datums.
|
||||
-- These settings can be edited. The default values for
|
||||
-- the three axes are:
|
||||
-- Color: Quantity_NOC_PEACHPUFF
|
||||
-- Type of line: Aspect_TOL_SOLID Width: 1.
|
||||
is redefined static;
|
||||
|
||||
--
|
||||
-- Attributes for the presentation of a dimensions.
|
||||
--
|
||||
|
||||
DimensionAspect (me : mutable) returns DimensionAspect from Prs3d is redefined static;
|
||||
---Purpose: Returns a link with Prs3d_Drawer_DimensionAspect,
|
||||
-- which provides settings for the appearance of dimensions.
|
||||
|
||||
HasDimensionAspect (me) returns Boolean from Standard is static;
|
||||
---C++: inline
|
||||
-- Purpose: Returns true if the Drawer has a dimension aspect setting active.
|
||||
|
||||
SetDimLengthModelUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets dimension length model units for computing of dimension presentation.
|
||||
|
||||
SetDimAngleModelUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets dimension angle model units for computing of dimension presentation.
|
||||
|
||||
DimAngleModelUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns angle model units for the dimension presentation.
|
||||
---C++: return const &
|
||||
|
||||
DimLengthModelUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns length model units for the dimension presentation.
|
||||
---C++: return const &
|
||||
|
||||
SetDimLengthDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets length units in which value for dimension presentation is displayed.
|
||||
|
||||
SetDimAngleDisplayUnits (me: mutable; theUnits : AsciiString from TCollection) is redefined static;
|
||||
---Purpose: Sets angle units in which value for dimension presentation is displayed.
|
||||
|
||||
DimLengthDisplayUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns length units in which dimension presentation is displayed.
|
||||
---C++: return const &
|
||||
|
||||
DimAngleDisplayUnits (me) returns AsciiString from TCollection is redefined static;
|
||||
---Purpose: Returns angle units in which dimension presentation is displayed.
|
||||
---C++: return const &
|
||||
|
||||
-- Attributes for the sections
|
||||
|
||||
SectionAspect (me:mutable) returns LineAspect from Prs3d
|
||||
---Purpose: Returns a link with Prs3d_Drawer_SectionAspect,
|
||||
-- which provides settings for wires which highlight sections.
|
||||
-- The LineAspect for the wire can be edited.
|
||||
-- The default values are:
|
||||
-- Color: Quantity_NOC_ORANGE
|
||||
-- Type of line: Aspect_TOL_SOLID
|
||||
-- Width: 1.
|
||||
-- These attributes are used by the following algorithms:
|
||||
-- Prs3d_WFShape
|
||||
is redefined static;
|
||||
|
||||
Link(me:mutable) returns any Drawer from Prs3d
|
||||
is static;
|
||||
---C++: return const&
|
||||
|
||||
HasLink(me) returns Boolean from Standard
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
Link (me:mutable; aDrawer: Drawer from Prs3d)
|
||||
is static;
|
||||
---C++: inline
|
||||
|
||||
|
||||
ClearLocalAttributes(me:mutable) is virtual;
|
||||
---Purpose: Removes attributes stored in a Local Context.
|
||||
|
||||
WasLastLocal(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose: Returns true if the last called attribute was local; false if it was global.
|
||||
|
||||
HasLocalAttributes(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns true if a Local Context has stored attributes
|
||||
-- for Interactive Objects.
|
||||
|
||||
fields
|
||||
|
||||
myLink : Drawer from Prs3d;
|
||||
hasLocalAttributes : Boolean from Standard;
|
||||
|
||||
myhasOwnDeviationCoefficient : Boolean from Standard;
|
||||
myOwnDeviationCoefficient : Real from Standard;
|
||||
myPreviousDeviationCoefficient : Real from Standard;
|
||||
|
||||
myhasOwnHLRDeviationCoefficient : Boolean from Standard;
|
||||
myOwnHLRDeviationCoefficient : Real from Standard;
|
||||
myPreviousHLRDeviationCoefficient: Real from Standard;
|
||||
|
||||
myhasOwnDeviationAngle : Boolean from Standard;
|
||||
myOwnDeviationAngle : Real from Standard;
|
||||
myPreviousDeviationAngle : Real from Standard;
|
||||
|
||||
myhasOwnHLRDeviationAngle : Boolean from Standard;
|
||||
myOwnHLRDeviationAngle : Real from Standard;
|
||||
myPreviousHLRDeviationAngle : Real from Standard;
|
||||
myHasOwnFaceBoundaryDraw : Boolean from Standard;
|
||||
|
||||
myHasOwnDimLengthModelUnits : Boolean from Standard;
|
||||
myHasOwnDimLengthDisplayUnits : Boolean from Standard;
|
||||
myHasOwnDimAngleModelUnits : Boolean from Standard;
|
||||
myHasOwnDimAngleDisplayUnits : Boolean from Standard;
|
||||
|
||||
end Drawer;
|
||||
|
||||
|
@@ -1,418 +0,0 @@
|
||||
// Copyright (c) 1998-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Drawer.ixx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : AIS_Drawer
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
AIS_Drawer::AIS_Drawer()
|
||||
: myLink (new Prs3d_Drawer()),
|
||||
hasLocalAttributes (Standard_False),
|
||||
myhasOwnDeviationCoefficient (Standard_False),
|
||||
myPreviousDeviationCoefficient (0.1),
|
||||
myhasOwnHLRDeviationCoefficient (Standard_False),
|
||||
myhasOwnDeviationAngle (Standard_False),
|
||||
myhasOwnHLRDeviationAngle (Standard_False),
|
||||
myHasOwnFaceBoundaryDraw (Standard_False),
|
||||
myHasOwnDimLengthModelUnits (Standard_False),
|
||||
myHasOwnDimLengthDisplayUnits (Standard_False),
|
||||
myHasOwnDimAngleModelUnits (Standard_False),
|
||||
myHasOwnDimAngleDisplayUnits (Standard_False)
|
||||
{
|
||||
SetMaximalParameterValue (500000.0);
|
||||
myLink->SetMaximalParameterValue (500000.0);
|
||||
SetTypeOfHLR (Prs3d_TOH_NotSet);
|
||||
SetVertexDrawMode (Prs3d_VDM_Inherited);
|
||||
}
|
||||
|
||||
Aspect_TypeOfDeflection AIS_Drawer::TypeOfDeflection () const
|
||||
{
|
||||
return myLink->TypeOfDeflection();
|
||||
}
|
||||
|
||||
Standard_Boolean AIS_Drawer::IsoOnPlane() const
|
||||
{
|
||||
return myLink->IsoOnPlane();
|
||||
}
|
||||
|
||||
Standard_Integer AIS_Drawer::Discretisation() const
|
||||
{
|
||||
return myLink->Discretisation();
|
||||
}
|
||||
|
||||
Quantity_Length AIS_Drawer::MaximalChordialDeviation() const
|
||||
{
|
||||
return myLink->MaximalChordialDeviation();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetDeviationCoefficient ( const Standard_Real aCoefficient )
|
||||
{
|
||||
myPreviousDeviationCoefficient = DeviationCoefficient() ;
|
||||
myOwnDeviationCoefficient = aCoefficient ;
|
||||
myhasOwnDeviationCoefficient = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetHLRDeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetHLRDeviationCoefficient ( const Standard_Real aCoefficient )
|
||||
{
|
||||
myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient() ;
|
||||
myOwnHLRDeviationCoefficient = aCoefficient ;
|
||||
myhasOwnHLRDeviationCoefficient = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDeviationAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetDeviationAngle ( const Standard_Real anAngle )
|
||||
{
|
||||
myPreviousDeviationAngle = DeviationAngle() ;
|
||||
myOwnDeviationAngle = anAngle ;
|
||||
myhasOwnDeviationAngle = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetHLRAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Drawer::SetHLRAngle ( const Standard_Real anAngle )
|
||||
{
|
||||
myPreviousHLRDeviationAngle = HLRAngle() ;
|
||||
myOwnHLRDeviationAngle = anAngle ;
|
||||
myhasOwnHLRDeviationAngle = Standard_True;
|
||||
}
|
||||
|
||||
/////// Get
|
||||
//=======================================================================
|
||||
//function : DeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::DeviationCoefficient () const
|
||||
{
|
||||
return myhasOwnDeviationCoefficient? myOwnDeviationCoefficient :myLink->DeviationCoefficient();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HLRDeviationCoefficient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::HLRDeviationCoefficient () const
|
||||
{
|
||||
return myhasOwnHLRDeviationCoefficient?myOwnHLRDeviationCoefficient : myLink->HLRDeviationCoefficient() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DeviationAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::DeviationAngle () const
|
||||
{
|
||||
return myhasOwnDeviationAngle ? myOwnDeviationAngle : myLink->DeviationAngle();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HLRAngle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AIS_Drawer::HLRAngle () const
|
||||
{
|
||||
|
||||
return myhasOwnHLRDeviationAngle ? myOwnHLRDeviationAngle : myLink->HLRAngle();
|
||||
}
|
||||
|
||||
Standard_Real AIS_Drawer::MaximalParameterValue () const
|
||||
{ return myLink->MaximalParameterValue();}
|
||||
|
||||
Handle (Prs3d_IsoAspect) AIS_Drawer::UIsoAspect ()
|
||||
{ return myUIsoAspect.IsNull() ? myLink->UIsoAspect (): myUIsoAspect;}
|
||||
|
||||
Handle (Prs3d_IsoAspect) AIS_Drawer::VIsoAspect ()
|
||||
{ return myVIsoAspect.IsNull() ? myLink->VIsoAspect (): myVIsoAspect;}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::FreeBoundaryAspect ()
|
||||
{return myFreeBoundaryAspect.IsNull() ? myLink->FreeBoundaryAspect (): myFreeBoundaryAspect;}
|
||||
|
||||
Standard_Boolean AIS_Drawer::FreeBoundaryDraw () const
|
||||
{return myLink->FreeBoundaryDraw();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::UnFreeBoundaryAspect ()
|
||||
{return myUnFreeBoundaryAspect.IsNull() ? myLink->UnFreeBoundaryAspect (): myUnFreeBoundaryAspect;}
|
||||
|
||||
Standard_Boolean AIS_Drawer::UnFreeBoundaryDraw () const
|
||||
{return myLink->UnFreeBoundaryDraw ();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::WireAspect ()
|
||||
{ return myWireAspect.IsNull()? myLink->WireAspect (): myWireAspect;}
|
||||
|
||||
Standard_Boolean AIS_Drawer::WireDraw () const
|
||||
{ return myLink->WireDraw();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::LineAspect ()
|
||||
{ return myLineAspect.IsNull() ? myLink->LineAspect (): myLineAspect;}
|
||||
|
||||
Handle (Prs3d_TextAspect) AIS_Drawer::TextAspect ()
|
||||
{ return myTextAspect.IsNull() ? myLink->TextAspect () : myTextAspect ;}
|
||||
|
||||
Handle (Prs3d_ShadingAspect) AIS_Drawer::ShadingAspect ()
|
||||
{
|
||||
return myShadingAspect.IsNull() ? myLink->ShadingAspect () : myShadingAspect ;
|
||||
}
|
||||
|
||||
Standard_Boolean AIS_Drawer::ShadingAspectGlobal() const
|
||||
{ return myLink->ShadingAspectGlobal();}
|
||||
|
||||
|
||||
Standard_Boolean AIS_Drawer::LineArrowDraw () const
|
||||
{ return myLink->LineArrowDraw();}
|
||||
|
||||
Handle (Prs3d_ArrowAspect) AIS_Drawer::ArrowAspect()
|
||||
{return myArrowAspect.IsNull()? myLink->ArrowAspect () : myArrowAspect;}
|
||||
|
||||
Handle (Prs3d_PointAspect) AIS_Drawer::PointAspect()
|
||||
{return myPointAspect.IsNull()? myLink->PointAspect () : myPointAspect;}
|
||||
|
||||
void AIS_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode)
|
||||
{
|
||||
// Assuming that myLink always exists --> Prs3d_VDM_Inherited value is acceptable.
|
||||
// So we simply store the new mode, as opposed to Prs3d_Drawer::SetVertexDrawMode()
|
||||
myVertexDrawMode = theMode;
|
||||
}
|
||||
|
||||
Prs3d_VertexDrawMode AIS_Drawer::VertexDrawMode () const
|
||||
{
|
||||
return IsOwnVertexDrawMode() ? myVertexDrawMode : myLink->VertexDrawMode();
|
||||
}
|
||||
|
||||
Standard_Boolean AIS_Drawer::DrawHiddenLine () const
|
||||
{return myLink->DrawHiddenLine();}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::HiddenLineAspect ()
|
||||
{return myHiddenLineAspect.IsNull()? myLink->HiddenLineAspect () : myHiddenLineAspect;}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::SeenLineAspect ()
|
||||
{ return mySeenLineAspect.IsNull() ? myLink->SeenLineAspect (): mySeenLineAspect ;}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::VectorAspect ()
|
||||
{return myVectorAspect.IsNull()? myLink->VectorAspect () : myVectorAspect;}
|
||||
|
||||
Handle (Prs3d_DatumAspect) AIS_Drawer::DatumAspect ()
|
||||
{return myDatumAspect.IsNull()? myLink->DatumAspect () : myDatumAspect; }
|
||||
|
||||
Handle (Prs3d_PlaneAspect) AIS_Drawer::PlaneAspect ()
|
||||
{return myPlaneAspect.IsNull() ? myLink->PlaneAspect (): myPlaneAspect;}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimensionAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle (Prs3d_DimensionAspect) AIS_Drawer::DimensionAspect()
|
||||
{
|
||||
return myDimensionAspect.IsNull()? myLink->DimensionAspect () : myDimensionAspect;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimAngleModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimAngleModelUnits() const
|
||||
{
|
||||
return myHasOwnDimAngleModelUnits
|
||||
? Prs3d_Drawer::DimAngleModelUnits()
|
||||
: myLink->DimAngleModelUnits();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimensionModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimLengthModelUnits() const
|
||||
{
|
||||
return myHasOwnDimLengthModelUnits
|
||||
? Prs3d_Drawer::DimLengthModelUnits()
|
||||
: myLink->DimLengthModelUnits();
|
||||
}
|
||||
// =======================================================================
|
||||
// function : SetDimLengthModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimLengthModelUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimLengthModelUnits (theUnits);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDimAngleModelUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimAngleModelUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimAngleModelUnits (theUnits);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimAngleDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimAngleDisplayUnits() const
|
||||
{
|
||||
return myHasOwnDimAngleDisplayUnits
|
||||
? Prs3d_Drawer::DimAngleDisplayUnits()
|
||||
: myLink->DimAngleDisplayUnits();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DimLengthDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
const TCollection_AsciiString& AIS_Drawer::DimLengthDisplayUnits() const
|
||||
{
|
||||
return myHasOwnDimLengthDisplayUnits
|
||||
? Prs3d_Drawer::DimLengthDisplayUnits()
|
||||
: myLink->DimLengthDisplayUnits();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDimLengthDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimLengthDisplayUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimLengthDisplayUnits (theUnits);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetDimAngleDisplayUnits
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits)
|
||||
{
|
||||
myHasOwnDimAngleDisplayUnits = Standard_True;
|
||||
Prs3d_Drawer::SetDimAngleDisplayUnits (theUnits);
|
||||
}
|
||||
|
||||
Handle (Prs3d_LineAspect) AIS_Drawer::SectionAspect ()
|
||||
{return mySectionAspect.IsNull()? myLink->SectionAspect (): mySectionAspect;}
|
||||
|
||||
const Handle (Prs3d_Drawer)& AIS_Drawer::Link()
|
||||
{
|
||||
if(myLink.IsNull()) myLink = new Prs3d_Drawer();
|
||||
return myLink;
|
||||
}
|
||||
|
||||
void AIS_Drawer::ClearLocalAttributes()
|
||||
{
|
||||
if(myLink.IsNull()) return;
|
||||
// attention pas beau....
|
||||
// The Handles
|
||||
|
||||
if(!myUIsoAspect.IsNull()) myUIsoAspect.Nullify();
|
||||
if(!myVIsoAspect.IsNull()) myVIsoAspect.Nullify();
|
||||
if(!myFreeBoundaryAspect.IsNull()) myFreeBoundaryAspect.Nullify();
|
||||
if(!myUnFreeBoundaryAspect.IsNull()) myUnFreeBoundaryAspect.Nullify();
|
||||
if(!myWireAspect.IsNull()) myWireAspect.Nullify();
|
||||
if(!myLineAspect.IsNull()) myLineAspect.Nullify();
|
||||
if(!myTextAspect.IsNull()) myTextAspect.Nullify();
|
||||
if(!myShadingAspect.IsNull()) myShadingAspect.Nullify();
|
||||
if(!myPointAspect.IsNull()) myPointAspect.Nullify();
|
||||
if(!myPlaneAspect.IsNull()) myPlaneAspect.Nullify();
|
||||
if(!myArrowAspect.IsNull()) myArrowAspect.Nullify();
|
||||
if(!myHiddenLineAspect.IsNull()) myHiddenLineAspect.Nullify();
|
||||
if(!mySeenLineAspect.IsNull()) mySeenLineAspect.Nullify();
|
||||
if(!myVectorAspect.IsNull()) myVectorAspect .Nullify();
|
||||
if(!myDatumAspect.IsNull()) myDatumAspect.Nullify();
|
||||
if(!myDimensionAspect.IsNull()) myDimensionAspect.Nullify();
|
||||
if(!mySectionAspect.IsNull()) mySectionAspect.Nullify();
|
||||
if( myhasOwnHLRDeviationCoefficient ) myhasOwnHLRDeviationCoefficient = Standard_False;
|
||||
if(myhasOwnHLRDeviationAngle ) myhasOwnHLRDeviationAngle = Standard_False;
|
||||
if (!myFaceBoundaryAspect.IsNull()) myFaceBoundaryAspect.Nullify();
|
||||
|
||||
myHasOwnFaceBoundaryDraw = Standard_False;
|
||||
myHasOwnDimLengthModelUnits = Standard_False;
|
||||
myHasOwnDimLengthDisplayUnits = Standard_False;
|
||||
myHasOwnDimAngleModelUnits = Standard_False;
|
||||
myHasOwnDimAngleDisplayUnits = Standard_False;
|
||||
|
||||
hasLocalAttributes = Standard_False;
|
||||
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetFaceBoundaryDraw
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled)
|
||||
{
|
||||
myHasOwnFaceBoundaryDraw = Standard_True;
|
||||
myFaceBoundaryDraw = theIsEnabled;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : IsFaceBoundaryDraw
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Standard_Boolean AIS_Drawer::IsFaceBoundaryDraw() const
|
||||
{
|
||||
if (!IsOwnFaceBoundaryDraw ())
|
||||
{
|
||||
return myLink->IsFaceBoundaryDraw ();
|
||||
}
|
||||
|
||||
return myFaceBoundaryDraw;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetFaceBoundaryAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void AIS_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
|
||||
{
|
||||
myFaceBoundaryAspect = theAspect;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : FaceBoundaryAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(Prs3d_LineAspect) AIS_Drawer::FaceBoundaryAspect()
|
||||
{
|
||||
if (!IsOwnFaceBoundaryAspect ())
|
||||
{
|
||||
return myLink->FaceBoundaryAspect ();
|
||||
}
|
||||
|
||||
return myFaceBoundaryAspect;
|
||||
}
|
@@ -1,180 +0,0 @@
|
||||
// Created on: 1996-12-19
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::WasLastLocal() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasLocalAttributes() const
|
||||
{
|
||||
return hasLocalAttributes;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnDeviationCoefficient ? myPreviousDeviationCoefficient : 0.0;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousHLRDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnHLRDeviationCoefficient ? myPreviousHLRDeviationCoefficient : 0.0;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousDeviationAngle() const
|
||||
{
|
||||
return myhasOwnDeviationAngle ? myPreviousDeviationAngle : 0.0;
|
||||
}
|
||||
|
||||
inline Standard_Real AIS_Drawer::PreviousHLRDeviationAngle() const
|
||||
{
|
||||
return myhasOwnHLRDeviationAngle ? myPreviousHLRDeviationAngle : 0.0;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::Link (const Handle(Prs3d_Drawer)& theDrawer)
|
||||
{
|
||||
myLink = theDrawer;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasLink() const
|
||||
{
|
||||
return !myLink.IsNull();
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetDeviationCoefficient()
|
||||
{
|
||||
myhasOwnDeviationCoefficient = Standard_False;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetHLRDeviationCoefficient()
|
||||
{
|
||||
myhasOwnHLRDeviationCoefficient = Standard_False;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetDeviationAngle()
|
||||
{
|
||||
myhasOwnDeviationAngle = Standard_False;
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetHLRAngle()
|
||||
{
|
||||
myhasOwnHLRDeviationAngle = Standard_False;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnDeviationCoefficient;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnDeviationAngle() const
|
||||
{
|
||||
return myhasOwnDeviationAngle;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnHLRDeviationCoefficient() const
|
||||
{
|
||||
return myhasOwnHLRDeviationCoefficient;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnHLRDeviationAngle() const
|
||||
{
|
||||
return myhasOwnHLRDeviationAngle;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasTextAspect() const
|
||||
{
|
||||
return !myTextAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasWireAspect() const
|
||||
{
|
||||
return !myWireAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasLineAspect() const
|
||||
{
|
||||
return !myLineAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasShadingAspect() const
|
||||
{
|
||||
return !myShadingAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasPointAspect() const
|
||||
{
|
||||
return !myPointAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnVertexDrawMode() const
|
||||
{
|
||||
return (myVertexDrawMode != Prs3d_VDM_Inherited);
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasDatumAspect() const
|
||||
{
|
||||
return !myDatumAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasPlaneAspect() const
|
||||
{
|
||||
return !myPlaneAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasUIsoAspect() const
|
||||
{
|
||||
return !myUIsoAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasVIsoAspect() const
|
||||
{
|
||||
return !myVIsoAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasFreeBoundaryAspect() const
|
||||
{
|
||||
return !myFreeBoundaryAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasUnFreeBoundaryAspect() const
|
||||
{
|
||||
return !myUnFreeBoundaryAspect.IsNull();
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryDraw() const
|
||||
{
|
||||
return myHasOwnFaceBoundaryDraw;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::IsOwnFaceBoundaryAspect() const
|
||||
{
|
||||
return !myFaceBoundaryAspect.IsNull();
|
||||
}
|
||||
|
||||
inline void AIS_Drawer::SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)
|
||||
{
|
||||
myTypeOfHLR = theTypeOfHLR;
|
||||
}
|
||||
|
||||
inline Prs3d_TypeOfHLR AIS_Drawer::TypeOfHLR() const
|
||||
{
|
||||
return (myTypeOfHLR == Prs3d_TOH_NotSet) ? myLink->TypeOfHLR() : myTypeOfHLR;
|
||||
}
|
||||
|
||||
inline Standard_Boolean AIS_Drawer::HasDimensionAspect() const
|
||||
{
|
||||
return !myDimensionAspect.IsNull();
|
||||
}
|
@@ -26,12 +26,12 @@ uses
|
||||
Shape from TopoDS,
|
||||
Plane from Geom,
|
||||
PresentationManager3d from PrsMgr,
|
||||
Drawer from Prs3d,
|
||||
Presentation from Prs3d,
|
||||
Projector from Prs3d,
|
||||
Transformation from Geom,
|
||||
Selection from SelectMgr,
|
||||
Pnt from gp,
|
||||
Drawer from AIS,
|
||||
ExtendedString from TCollection,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
@@ -118,7 +118,7 @@ is
|
||||
-- ota -- begin
|
||||
ComputeTwoEdgesLength (myclass;
|
||||
aPresentation : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
ArrowSize : Real from Standard;
|
||||
FirstEdge : Edge from TopoDS;
|
||||
SecondEdge : Edge from TopoDS;
|
||||
@@ -138,7 +138,7 @@ is
|
||||
|
||||
ComputeTwoVerticesLength(myclass;
|
||||
aPresentation : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
ArrowSize : Real from Standard;
|
||||
FirstVertex : Vertex from TopoDS;
|
||||
SecondVertex : Vertex from TopoDS;
|
||||
@@ -158,7 +158,7 @@ is
|
||||
|
||||
ComputeOneEdgeOneVertexLength(myclass;
|
||||
aPresentation : Presentation from Prs3d;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
ArrowSize : Real from Standard;
|
||||
FirstShape : Shape from TopoDS;
|
||||
SecondShape : Shape from TopoDS;
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
//=======================================================================
|
||||
//function : AIS_EqualDistanceRelation
|
||||
@@ -363,7 +363,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const Standard_Real ArrowSize,
|
||||
const TopoDS_Edge & FirstEdge,
|
||||
const TopoDS_Edge & SecondEdge,
|
||||
@@ -591,7 +591,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
|
||||
//=======================================================================
|
||||
|
||||
void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const Standard_Real ArrowSize,
|
||||
const TopoDS_Vertex& FirstVertex,
|
||||
const TopoDS_Vertex& SecondVertex,
|
||||
@@ -682,7 +682,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
|
||||
//=======================================================================
|
||||
|
||||
void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Presentation )& aPresentation,
|
||||
const Handle( AIS_Drawer )& aDrawer,
|
||||
const Handle( Prs3d_Drawer )& aDrawer,
|
||||
const Standard_Real ArrowSize,
|
||||
const TopoDS_Shape & FirstShape,
|
||||
const TopoDS_Shape & SecondShape,
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_ArrowAspect.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : AIS_EqualRadiusRelation
|
||||
|
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
|
@@ -99,7 +99,6 @@ uses
|
||||
MapOfInteractive from AIS,
|
||||
InteractiveObject from AIS,
|
||||
DisplayMode from AIS,
|
||||
Drawer from AIS,
|
||||
NameOfMaterial from Graphic3d,
|
||||
--NameOfPhysicalMaterial from Graphic3d,
|
||||
Filter from SelectMgr,
|
||||
@@ -607,7 +606,7 @@ is
|
||||
|
||||
SetLocalAttributes(me : mutable;
|
||||
aniobj : InteractiveObject from AIS;
|
||||
aDrawer : Drawer from AIS;
|
||||
aDrawer : Drawer from Prs3d;
|
||||
updateviewer : Boolean from Standard = Standard_True);
|
||||
--- Purpose:
|
||||
-- Sets the attributes of the interactive object aniobj by
|
||||
@@ -946,7 +945,7 @@ is
|
||||
-- deviate from a tangent to a curve. If this limit is
|
||||
-- reached, a new triangle is begun.
|
||||
-- This deviation is absolute and is set through
|
||||
-- AIS_Drawer::SetMaximalChordialDeviation. The
|
||||
-- Prs3d_Drawer::SetMaximalChordialDeviation. The
|
||||
-- default value is 0.001.
|
||||
-- In drawing shapes, however, you are allowed to ask
|
||||
-- for a relative deviation. This deviation will be:
|
||||
|
@@ -2131,7 +2131,7 @@ void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)&
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetLocalAttributes (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Handle(AIS_Drawer)& theDrawer,
|
||||
const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Boolean theToUpdateViewer)
|
||||
{
|
||||
if (theIObj.IsNull())
|
||||
|
@@ -53,7 +53,6 @@ uses
|
||||
Box from Bnd,
|
||||
NameOfMaterial from Graphic3d,
|
||||
MaterialAspect from Graphic3d,
|
||||
Drawer from AIS,
|
||||
PToContext from AIS,
|
||||
TypeOfPresentation3d from PrsMgr,
|
||||
InteractiveContext from AIS,
|
||||
@@ -485,16 +484,8 @@ is
|
||||
|
||||
UnsetTransparency(me:mutable) is virtual;
|
||||
---Purpose: Removes the transparency setting. The object is opaque by default.
|
||||
|
||||
SetAttributes(me:mutable; aDrawer: Drawer from AIS) is virtual;
|
||||
---Purpose: Initializes the drawing tool aDrawer.
|
||||
|
||||
Attributes(me) returns any Drawer from AIS;
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
---Purpose: Returns the attributes settings.
|
||||
|
||||
UnsetAttributes(me:mutable) is virtual;
|
||||
|
||||
UnsetAttributes(me:mutable) is redefined virtual;
|
||||
---Purpose: Clears settings provided by the drawing tool aDrawer.
|
||||
|
||||
---Category: information about Prs to be recomputed
|
||||
@@ -597,7 +588,6 @@ fields
|
||||
|
||||
-- The Information Fields
|
||||
|
||||
myDrawer : Drawer from AIS is protected ;
|
||||
myTransparency : Real from Standard is protected;
|
||||
myOwnColor : Color from Quantity is protected;
|
||||
myOwnMaterial : NameOfMaterial from Graphic3d is protected;
|
||||
|
@@ -45,7 +45,6 @@
|
||||
AIS_InteractiveObject::
|
||||
AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
|
||||
SelectMgr_SelectableObject(aTypeOfPresentation3d),
|
||||
myDrawer(new AIS_Drawer()),
|
||||
myTransparency(0.),
|
||||
myOwnColor(Quantity_NOC_WHITE),
|
||||
myOwnMaterial(Graphic3d_NOM_DEFAULT),
|
||||
@@ -130,12 +129,6 @@ void AIS_InteractiveObject::SetContext(const Handle(AIS_InteractiveContext)& aCt
|
||||
myCTXPtr = aCtx.operator->();
|
||||
if( aCtx.IsNull())
|
||||
return;
|
||||
if (myDrawer.IsNull()) {
|
||||
myDrawer = new AIS_Drawer;
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "AIS_InteractiveObject::SetContext DRAWER NUL!" << endl;
|
||||
#endif
|
||||
}
|
||||
myDrawer->Link(aCtx->DefaultDrawer());
|
||||
}
|
||||
|
||||
@@ -285,15 +278,14 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
//void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfPhysicalMaterial aName)
|
||||
{
|
||||
if( HasColor() || IsTransparent() || HasMaterial() )
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial(aName);
|
||||
}
|
||||
myOwnMaterial = aName;
|
||||
hasOwnMaterial = Standard_True;
|
||||
}
|
||||
@@ -304,17 +296,16 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_NameOfMaterial aName)
|
||||
|
||||
void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
|
||||
{
|
||||
if( HasColor() || IsTransparent() || HasMaterial() )
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
if (HasColor() || IsTransparent() || HasMaterial())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->SetMaterial(aMat);
|
||||
}
|
||||
hasOwnMaterial = Standard_True;
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function :
|
||||
@@ -323,11 +314,14 @@ void AIS_InteractiveObject::SetMaterial(const Graphic3d_MaterialAspect& aMat)
|
||||
void AIS_InteractiveObject::UnsetMaterial()
|
||||
{
|
||||
if( !HasMaterial() ) return;
|
||||
if( HasColor() || IsTransparent()) {
|
||||
myDrawer->ShadingAspect()->SetMaterial(
|
||||
AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
if( HasColor() ) SetColor(myOwnColor);
|
||||
if( IsTransparent() ) SetTransparency(myTransparency);
|
||||
if (HasColor() || IsTransparent())
|
||||
{
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (AIS_GraphicTool::GetMaterial (myDrawer->Link()));
|
||||
}
|
||||
if (HasColor()) SetColor (myOwnColor);
|
||||
if (IsTransparent()) SetTransparency (myTransparency);
|
||||
}
|
||||
else{
|
||||
Handle(Prs3d_ShadingAspect) SA;
|
||||
@@ -342,12 +336,11 @@ void AIS_InteractiveObject::UnsetMaterial()
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
|
||||
{
|
||||
|
||||
|
||||
if(!HasColor() && !IsTransparent() && !HasMaterial() ) {
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
if(!myDrawer->Link().IsNull())
|
||||
myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
if(!HasColor() && !IsTransparent() && !HasMaterial())
|
||||
{
|
||||
myDrawer->SetShadingAspect(new Prs3d_ShadingAspect());
|
||||
if(myDrawer->HasLink())
|
||||
myDrawer->ShadingAspect()->SetMaterial(AIS_GraphicTool::GetMaterial(myDrawer->Link()));
|
||||
}
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
@@ -363,14 +356,14 @@ void AIS_InteractiveObject::SetTransparency(const Standard_Real aValue)
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetTransparency()
|
||||
{
|
||||
if(HasColor() || HasMaterial() )
|
||||
{
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
FMat.SetTransparency(0.); BMat.SetTransparency(0.);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
}
|
||||
if(HasColor() || HasMaterial() )
|
||||
{
|
||||
Graphic3d_MaterialAspect FMat = myDrawer->ShadingAspect()->Aspect()->FrontMaterial();
|
||||
Graphic3d_MaterialAspect BMat = myDrawer->ShadingAspect()->Aspect()->BackMaterial();
|
||||
FMat.SetTransparency(0.); BMat.SetTransparency(0.);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetFrontMaterial(FMat);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackMaterial(BMat);
|
||||
}
|
||||
else{
|
||||
Handle (Prs3d_ShadingAspect) SA;
|
||||
myDrawer->SetShadingAspect(SA);
|
||||
@@ -388,25 +381,14 @@ Standard_Real AIS_InteractiveObject::Transparency() const
|
||||
// return Mat.Transparency();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetAttributes(const Handle(AIS_Drawer)& aDrawer)
|
||||
{myDrawer = aDrawer;}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetAttributes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::UnsetAttributes()
|
||||
{
|
||||
Handle(AIS_Drawer) dr = new AIS_Drawer();
|
||||
if(myDrawer->HasLink())
|
||||
dr->Link(myDrawer->Link());
|
||||
myDrawer = dr;
|
||||
SelectMgr_SelectableObject::UnsetAttributes();
|
||||
|
||||
hasOwnColor = Standard_False;
|
||||
hasOwnMaterial = Standard_False;
|
||||
myOwnWidth = 0.0;
|
||||
@@ -588,7 +570,7 @@ void AIS_InteractiveObject::SetPolygonOffsets(const Standard_Integer aMode,
|
||||
Standard_Boolean AIS_InteractiveObject::HasPolygonOffsets() const
|
||||
{
|
||||
return !( myDrawer->ShadingAspect().IsNull() ||
|
||||
( !myDrawer->Link().IsNull() &&
|
||||
( myDrawer->HasLink() &&
|
||||
myDrawer->ShadingAspect() == myDrawer->Link()->ShadingAspect() ) );
|
||||
}
|
||||
|
||||
|
@@ -78,10 +78,6 @@ inline Graphic3d_NameOfMaterial AIS_InteractiveObject::Material() const
|
||||
//inline Graphic3d_NameOfPhysicalMaterial AIS_InteractiveObject::Material() const
|
||||
{return myOwnMaterial;}
|
||||
|
||||
inline const Handle(AIS_Drawer)&
|
||||
AIS_InteractiveObject::Attributes() const
|
||||
{return myDrawer;}
|
||||
|
||||
inline Standard_Boolean AIS_InteractiveObject::HasHilightMode() const
|
||||
{return myHilightMode!=-1;}
|
||||
|
||||
|
@@ -16,13 +16,13 @@
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Dimension.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
@@ -44,7 +44,6 @@ class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class SelectMgr_Selection;
|
||||
class AIS_Drawer;
|
||||
class Bnd_Box;
|
||||
class gp_Dir;
|
||||
class TopoDS_Vertex;
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include <StdPrs_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <GC_MakeSegment.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
@@ -167,9 +166,10 @@ void AIS_Line::SetColor(const Quantity_Color &aCol)
|
||||
myOwnColor=aCol;
|
||||
|
||||
Standard_Real WW = HasWidth()? myOwnWidth:
|
||||
AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
||||
|
||||
if (!myDrawer->HasLineAspect ())
|
||||
if (!myDrawer->HasOwnLineAspect ())
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
else
|
||||
myDrawer->LineAspect()->SetColor(aCol);
|
||||
@@ -188,9 +188,9 @@ void AIS_Line::UnsetColor()
|
||||
|
||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Quantity_Color CC;
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->LineAspect()->SetColor(CC);
|
||||
myOwnColor = CC;
|
||||
}
|
||||
@@ -204,11 +204,11 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
|
||||
{
|
||||
myOwnWidth=aValue;
|
||||
|
||||
if (!myDrawer->HasLineAspect ()) {
|
||||
Quantity_Color CC;
|
||||
if (!myDrawer->HasOwnLineAspect ()) {
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if( HasColor() ) CC = myOwnColor;
|
||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
||||
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
|
||||
myDrawer->SetLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
|
||||
} else
|
||||
myDrawer->LineAspect()->SetWidth(aValue);
|
||||
}
|
||||
@@ -224,7 +224,8 @@ void AIS_Line::UnsetWidth()
|
||||
|
||||
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
|
||||
else{
|
||||
Standard_Real WW = AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
Standard_Real WW = myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.;
|
||||
myDrawer->LineAspect()->SetWidth(WW);
|
||||
myOwnWidth = WW;
|
||||
}
|
||||
|
@@ -56,7 +56,6 @@
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <DsgPrs_EllipseRadiusPresentation.hxx>
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <gce_MakeLin.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
@@ -57,7 +57,6 @@
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <DsgPrs_EllipseRadiusPresentation.hxx>
|
||||
|
@@ -19,7 +19,6 @@
|
||||
#include <AIS_OffsetDimension.ixx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <Select3D_SensitiveSegment.hxx>
|
||||
|
@@ -53,8 +53,6 @@
|
||||
|
||||
#include <Poly_Triangulation.hxx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//=======================================================================
|
||||
@@ -375,10 +373,10 @@ void AIS_Plane::SetSize(const Standard_Real aXLength,
|
||||
DA = myDrawer->DatumAspect();
|
||||
|
||||
Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
|
||||
if(myDrawer->Link()->PlaneAspect() == PA){
|
||||
if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
|
||||
yenavaitPA = Standard_False;
|
||||
PA = new Prs3d_PlaneAspect();}
|
||||
if(myDrawer->Link()->DatumAspect() == DA){
|
||||
if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
|
||||
yenavaitDA = Standard_False;
|
||||
DA = new Prs3d_DatumAspect();
|
||||
}
|
||||
@@ -406,13 +404,16 @@ void AIS_Plane::UnsetSize()
|
||||
{
|
||||
|
||||
if(!myHasOwnSize) return;
|
||||
if(!hasOwnColor){
|
||||
myDrawer->PlaneAspect().Nullify();
|
||||
myDrawer->DatumAspect().Nullify();
|
||||
if(!hasOwnColor)
|
||||
{
|
||||
myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
|
||||
myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
|
||||
}
|
||||
else{
|
||||
const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
|
||||
const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
|
||||
const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
|
||||
new Prs3d_PlaneAspect();
|
||||
const Handle(Prs3d_DatumAspect) DA = myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() :
|
||||
new Prs3d_DatumAspect();
|
||||
|
||||
myDrawer->PlaneAspect()->SetPlaneLength(PA->PlaneXLength(),PA->PlaneYLength());
|
||||
myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
|
||||
@@ -461,10 +462,10 @@ void AIS_Plane::SetColor(const Quantity_Color &aCol)
|
||||
DA = myDrawer->DatumAspect();
|
||||
|
||||
Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
|
||||
if(myDrawer->Link()->PlaneAspect() == PA){
|
||||
if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
|
||||
yenavaitPA = Standard_False;
|
||||
PA = new Prs3d_PlaneAspect();}
|
||||
if(myDrawer->Link()->DatumAspect() == DA){
|
||||
if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
|
||||
yenavaitDA = Standard_False;
|
||||
DA = new Prs3d_DatumAspect();
|
||||
}
|
||||
@@ -491,12 +492,14 @@ void AIS_Plane::SetColor(const Quantity_Color &aCol)
|
||||
void AIS_Plane::UnsetColor()
|
||||
{
|
||||
if(!hasOwnColor) return;
|
||||
if(!myHasOwnSize){
|
||||
myDrawer->PlaneAspect().Nullify();
|
||||
myDrawer->DatumAspect().Nullify();
|
||||
if(!myHasOwnSize)
|
||||
{
|
||||
myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
|
||||
myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
|
||||
}
|
||||
else{
|
||||
const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
|
||||
const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
|
||||
new Prs3d_PlaneAspect();
|
||||
// const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
|
||||
Quantity_Color C;Aspect_TypeOfLine T;Standard_Real W;
|
||||
PA->EdgesAspect()->Aspect()->Values(C,T,W);
|
||||
|
@@ -43,7 +43,6 @@
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <UnitsAPI.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include <StdPrs_Point.hxx>
|
||||
#include <Geom_Point.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
//=======================================================================
|
||||
@@ -209,8 +208,9 @@ AcceptDisplayMode(const Standard_Integer aMode) const
|
||||
void AIS_Point::UpdatePointValues()
|
||||
{
|
||||
|
||||
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM){
|
||||
myDrawer->PointAspect().Nullify();
|
||||
if(!hasOwnColor && myOwnWidth==0.0 && !myHasTOM)
|
||||
{
|
||||
myDrawer->SetPointAspect (Handle(Prs3d_PointAspect)());
|
||||
return;
|
||||
}
|
||||
Quantity_Color aCol;
|
||||
@@ -232,7 +232,7 @@ void AIS_Point::UpdatePointValues()
|
||||
if(myHasTOM) aTOM = myTOM;
|
||||
|
||||
|
||||
if(myDrawer->HasPointAspect()){
|
||||
if(myDrawer->HasOwnPointAspect()){
|
||||
// CLE
|
||||
// const Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
||||
Handle(Prs3d_PointAspect) PA = myDrawer->PointAspect();
|
||||
|
@@ -15,11 +15,11 @@
|
||||
|
||||
#include <AIS_PointCloud.hxx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
@@ -153,15 +153,21 @@ void AIS_PointCloud::SetColor (const Quantity_Color& theColor)
|
||||
{
|
||||
AIS_InteractiveObject::SetColor(theColor);
|
||||
|
||||
if (!myDrawer->HasPointAspect())
|
||||
if (!myDrawer->HasOwnPointAspect())
|
||||
{
|
||||
myDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, theColor, 1.0));
|
||||
*myDrawer->PointAspect()->Aspect() = *myDrawer->Link()->PointAspect()->Aspect();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->PointAspect()->Aspect() = *myDrawer->Link()->PointAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!myDrawer->HasShadingAspect())
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
// Override color
|
||||
@@ -220,20 +226,32 @@ void AIS_PointCloud::UnsetColor()
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity_Color aColor;
|
||||
Quantity_Color aColor = Quantity_NOC_YELLOW;
|
||||
Aspect_TypeOfMarker aType = Aspect_TOM_POINT;
|
||||
Standard_Real aScale = 1.0;
|
||||
myDrawer->Link()->PointAspect()->Aspect()->Values (aColor, aType, aScale);
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->Link()->PointAspect()->Aspect()->Values (aColor, aType, aScale);
|
||||
}
|
||||
myDrawer->PointAspect()->SetColor (aColor);
|
||||
}
|
||||
|
||||
if (HasMaterial()
|
||||
|| IsTransparent())
|
||||
{
|
||||
Graphic3d_MaterialAspect aMat = AIS_GraphicTool::GetMaterial (HasMaterial() ? myDrawer : myDrawer->Link());
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect aMat = aDefaultMat;
|
||||
if (HasMaterial() || myDrawer->HasLink())
|
||||
{
|
||||
aMat = AIS_GraphicTool::GetMaterial (HasMaterial() ? myDrawer : myDrawer->Link());
|
||||
}
|
||||
if (HasMaterial())
|
||||
{
|
||||
Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
Quantity_Color aColor = aDefaultMat.AmbientColor();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
}
|
||||
aMat.SetColor (aColor);
|
||||
}
|
||||
if (IsTransparent())
|
||||
@@ -298,10 +316,13 @@ void AIS_PointCloud::SetMaterial (const Graphic3d_NameOfMaterial theMatName)
|
||||
//=======================================================================
|
||||
void AIS_PointCloud::SetMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
{
|
||||
if (!myDrawer->HasShadingAspect())
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
hasOwnMaterial = Standard_True;
|
||||
|
||||
@@ -350,7 +371,10 @@ void AIS_PointCloud::UnsetMaterial()
|
||||
if (HasColor()
|
||||
|| IsTransparent())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->HasLink() ?
|
||||
myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel) :
|
||||
aDefaultMat,
|
||||
myCurrentFacingModel);
|
||||
if (HasColor())
|
||||
{
|
||||
@@ -408,7 +432,7 @@ void AIS_PointCloud::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
|
||||
}
|
||||
|
||||
Handle(Graphic3d_AspectMarker3d) aMarkerAspect = myDrawer->PointAspect()->Aspect();
|
||||
if (!myDrawer->HasPointAspect())
|
||||
if (!myDrawer->HasOwnPointAspect())
|
||||
{
|
||||
aMarkerAspect->SetType (Aspect_TOM_POINT);
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <AIS_Relation.ixx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
@@ -27,6 +26,7 @@
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_DimensionAspect.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
@@ -81,7 +81,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)&
|
||||
const Aspect_TypeOfLine aProjTOL,
|
||||
const Aspect_TypeOfLine aCallTOL) const
|
||||
{
|
||||
if (!myDrawer->HasWireAspect()){
|
||||
if (!myDrawer->HasOwnWireAspect()){
|
||||
myDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aProjTOL,2.));}
|
||||
else {
|
||||
const Handle(Prs3d_LineAspect)& li = myDrawer->WireAspect();
|
||||
@@ -171,7 +171,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
||||
const Aspect_TypeOfMarker aProjTOM,
|
||||
const Aspect_TypeOfLine aCallTOL) const
|
||||
{
|
||||
if (!myDrawer->HasPointAspect()){
|
||||
if (!myDrawer->HasOwnPointAspect()){
|
||||
myDrawer->SetPointAspect(new Prs3d_PointAspect(aProjTOM, aColor,1));}
|
||||
else {
|
||||
const Handle(Prs3d_PointAspect)& pa = myDrawer->PointAspect();
|
||||
@@ -182,7 +182,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
||||
// calcul du projete
|
||||
StdPrs_Point::Add(aPrs, new Geom_CartesianPoint(ProjPoint), myDrawer);
|
||||
|
||||
if (!myDrawer->HasWireAspect()){
|
||||
if (!myDrawer->HasOwnWireAspect()){
|
||||
myDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aCallTOL,2.));}
|
||||
else {
|
||||
const Handle(Prs3d_LineAspect)& li = myDrawer->WireAspect();
|
||||
@@ -213,16 +213,17 @@ void AIS_Relation::SetColor(const Quantity_Color &aCol)
|
||||
{
|
||||
if(hasOwnColor && myOwnColor==aCol) return;
|
||||
|
||||
if (!myDrawer->HasTextAspect()) myDrawer->SetTextAspect(new Prs3d_TextAspect());
|
||||
if (!myDrawer->HasOwnTextAspect()) myDrawer->SetTextAspect(new Prs3d_TextAspect());
|
||||
hasOwnColor=Standard_True;
|
||||
myOwnColor=aCol;
|
||||
myDrawer->TextAspect()->SetColor(aCol);
|
||||
|
||||
Standard_Real WW = HasWidth()? Width():AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line);
|
||||
if (!myDrawer->HasLineAspect()) {
|
||||
Standard_Real WW = HasWidth()? Width(): myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
|
||||
if (!myDrawer->HasOwnLineAspect()) {
|
||||
myDrawer->SetLineAspect(new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
|
||||
}
|
||||
if (!myDrawer->HasDimensionAspect()) {
|
||||
if (!myDrawer->HasOwnDimensionAspect()) {
|
||||
myDrawer->SetDimensionAspect(new Prs3d_DimensionAspect);
|
||||
}
|
||||
|
||||
@@ -244,11 +245,14 @@ void AIS_Relation::UnsetColor()
|
||||
if (!hasOwnColor) return;
|
||||
hasOwnColor = Standard_False;
|
||||
const Handle(Prs3d_LineAspect)& LA = myDrawer->LineAspect();
|
||||
Quantity_Color CC;
|
||||
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
Quantity_Color CC = Quantity_NOC_YELLOW;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||
myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
|
||||
}
|
||||
LA->SetColor(CC);
|
||||
myDrawer->DimensionAspect()->SetLineAspect(LA);
|
||||
myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -34,7 +34,7 @@ class Shape from AIS inherits InteractiveObject from AIS
|
||||
-- an inheriting shape class. These services allow you to
|
||||
-- select one type of shape interactive object for higher
|
||||
-- precision drawing. When you do this, the
|
||||
-- AIS_Drawer::IsOwn... functions corresponding to the
|
||||
-- Prs3d_Drawer::IsOwn... functions corresponding to the
|
||||
-- above deviation angle and coefficient functions return
|
||||
-- true indicating that there is a local setting available
|
||||
-- for the specific object.
|
||||
@@ -52,7 +52,6 @@ uses
|
||||
Projector from Prs3d,
|
||||
PresentationManager3d from PrsMgr,
|
||||
Selection from SelectMgr,
|
||||
Drawer from AIS,
|
||||
KindOfInteractive from AIS,
|
||||
Transformation from Geom,
|
||||
Drawer from Prs3d,
|
||||
@@ -99,7 +98,7 @@ uses
|
||||
---Purpose: Sets a local value for deviation coefficient for this specific shape.
|
||||
|
||||
SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;
|
||||
---Purpose: sets myOwnHLRDeviationCoefficient field in AIS_Drawer &
|
||||
---Purpose: sets myOwnHLRDeviationCoefficient field in Prs3d_Drawer &
|
||||
-- recomputes presentation
|
||||
|
||||
SetAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
|
||||
@@ -110,7 +109,7 @@ uses
|
||||
---Purpose: gives back the angle initial value put by the User.
|
||||
|
||||
SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;
|
||||
---Purpose: sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation
|
||||
---Purpose: sets myOwnDeviationAngle field in Prs3d_Drawer & recomputes presentation
|
||||
|
||||
|
||||
SetHLRAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
|
||||
@@ -118,7 +117,7 @@ uses
|
||||
-- and set the values stored in myDrawer for with these that become local to the shape
|
||||
|
||||
SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;
|
||||
---Purpose: sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation
|
||||
---Purpose: sets myOwnHLRDeviationAngle field in Prs3d_Drawer & recomputes presentation
|
||||
|
||||
|
||||
OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
|
||||
@@ -194,16 +193,16 @@ uses
|
||||
---Purpose: Sets the color aColor in the reconstructed
|
||||
-- compound shape. Acts via the Drawer methods below on the appearance of:
|
||||
-- - free boundaries:
|
||||
-- AIS_Drawer_FreeBoundaryAspect,
|
||||
-- - isos: AIS_Drawer_UIsoAspect,
|
||||
-- AIS_Drawer_VIsoAspect,
|
||||
-- Prs3d_Drawer_FreeBoundaryAspect,
|
||||
-- - isos: Prs3d_Drawer_UIsoAspect,
|
||||
-- Prs3dDrawer_VIsoAspect,
|
||||
-- - shared boundaries:
|
||||
-- AIS_Drawer_UnFreeBoundaryAspect,
|
||||
-- - shading: AIS_Drawer_ShadingAspect,
|
||||
-- Prs3d_Drawer_UnFreeBoundaryAspect,
|
||||
-- - shading: Prs3d_Drawer_ShadingAspect,
|
||||
-- - visible line color in hidden line mode:
|
||||
-- AIS_Drawer_SeenLineAspect
|
||||
-- Prs3d_Drawer_SeenLineAspect
|
||||
-- - hidden line color in hidden line mode:
|
||||
-- AIS_Drawer_HiddenLineAspect.
|
||||
-- Prs3d_Drawer_HiddenLineAspect.
|
||||
|
||||
SetColor(me:mutable;aColor:Color from Quantity)
|
||||
is redefined virtual;
|
||||
@@ -283,22 +282,22 @@ uses
|
||||
ashape : Shape from TopoDS) is static private;
|
||||
|
||||
setColor (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theColor : Color from Quantity)
|
||||
is protected;
|
||||
|
||||
setWidth (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theWidth : Real from Standard)
|
||||
is protected;
|
||||
|
||||
setTransparency (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theValue : Real from Standard)
|
||||
is protected;
|
||||
|
||||
setMaterial (me;
|
||||
theDrawer : Drawer from AIS;
|
||||
theDrawer : Drawer from Prs3d;
|
||||
theMaterial : MaterialAspect from Graphic3d;
|
||||
theToKeepColor : Boolean from Standard;
|
||||
theToKeepTransp : Boolean from Standard)
|
||||
|
@@ -66,7 +66,6 @@
|
||||
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <HLRBRep.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
@@ -94,10 +93,9 @@ static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard
|
||||
AIS_Shape::
|
||||
AIS_Shape(const TopoDS_Shape& shap):
|
||||
AIS_InteractiveObject(PrsMgr_TOP_ProjectorDependant),
|
||||
myshape(shap),
|
||||
myCompBB(Standard_True),
|
||||
myInitAng(0.)
|
||||
{
|
||||
Set (shap);
|
||||
myFirstCompute = Standard_True;
|
||||
SetHilightMode(0);
|
||||
myDrawer->SetShadingAspectGlobal(Standard_False);
|
||||
@@ -254,7 +252,7 @@ void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
|
||||
}
|
||||
|
||||
Handle (Prs3d_Drawer) defdrawer = GetContext()->DefaultDrawer();
|
||||
if (defdrawer->DrawHiddenLine())
|
||||
if (defdrawer->DrawHiddenLine())
|
||||
{myDrawer->EnableDrawHiddenLine();}
|
||||
else {myDrawer->DisableDrawHiddenLine();}
|
||||
|
||||
@@ -440,28 +438,40 @@ void AIS_Shape::SetColor(const Quantity_NameOfColor aCol)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setColor (const Handle(AIS_Drawer)& theDrawer,
|
||||
const Quantity_Color& theColor) const
|
||||
void AIS_Shape::setColor (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Quantity_Color& theColor) const
|
||||
{
|
||||
if (!theDrawer->HasShadingAspect())
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasLineAspect())
|
||||
if (!theDrawer->HasOwnLineAspect())
|
||||
{
|
||||
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasWireAspect())
|
||||
if (!theDrawer->HasOwnWireAspect())
|
||||
{
|
||||
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasPointAspect())
|
||||
if (!theDrawer->HasOwnPointAspect())
|
||||
{
|
||||
theDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_BLACK, 1.0));
|
||||
*theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
// disable dedicated line aspects
|
||||
theDrawer->SetFreeBoundaryAspect (theDrawer->LineAspect());
|
||||
@@ -559,26 +569,53 @@ void AIS_Shape::UnsetColor()
|
||||
}
|
||||
else
|
||||
{
|
||||
Quantity_Color aColor;
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, aColor);
|
||||
Quantity_Color aColor = Quantity_NOC_YELLOW;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, aColor);
|
||||
}
|
||||
myDrawer->LineAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Wire, aColor);
|
||||
aColor = Quantity_NOC_RED;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Wire, aColor);
|
||||
}
|
||||
myDrawer->WireAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Free, aColor);
|
||||
aColor = Quantity_NOC_GREEN;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Free, aColor);
|
||||
}
|
||||
myDrawer->FreeBoundaryAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_UnFree, aColor);
|
||||
aColor = Quantity_NOC_YELLOW;
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_UnFree, aColor);
|
||||
}
|
||||
myDrawer->UnFreeBoundaryAspect()->SetColor (aColor);
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Seen, aColor);
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Seen, aColor);
|
||||
}
|
||||
myDrawer->SeenLineAspect()->SetColor (aColor);
|
||||
}
|
||||
|
||||
if (HasMaterial()
|
||||
|| IsTransparent())
|
||||
{
|
||||
Graphic3d_MaterialAspect mat = AIS_GraphicTool::GetMaterial(HasMaterial()? myDrawer : myDrawer->Link());
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect mat = aDefaultMat;
|
||||
if (HasMaterial() || myDrawer->HasLink())
|
||||
{
|
||||
mat = AIS_GraphicTool::GetMaterial(HasMaterial()? myDrawer : myDrawer->Link());
|
||||
}
|
||||
if (HasMaterial())
|
||||
{
|
||||
Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
Quantity_Color aColor = aDefaultMat.AmbientColor();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
Quantity_Color aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
}
|
||||
mat.SetColor (aColor);
|
||||
}
|
||||
if (IsTransparent())
|
||||
@@ -638,18 +675,24 @@ void AIS_Shape::UnsetColor()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setWidth (const Handle(AIS_Drawer)& theDrawer,
|
||||
const Standard_Real theLineWidth) const
|
||||
void AIS_Shape::setWidth (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Real theLineWidth) const
|
||||
{
|
||||
if (!theDrawer->HasLineAspect())
|
||||
if (!theDrawer->HasOwnLineAspect())
|
||||
{
|
||||
theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
if (!theDrawer->HasWireAspect())
|
||||
if (!theDrawer->HasOwnWireAspect())
|
||||
{
|
||||
theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0));
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->WireAspect()->Aspect() = *theDrawer->Link()->WireAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
// disable dedicated line aspects
|
||||
theDrawer->SetFreeBoundaryAspect (theDrawer->LineAspect());
|
||||
@@ -701,11 +744,16 @@ void AIS_Shape::UnsetWidth()
|
||||
}
|
||||
else
|
||||
{
|
||||
myDrawer->LineAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line));
|
||||
myDrawer->WireAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Wire));
|
||||
myDrawer->FreeBoundaryAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Free));
|
||||
myDrawer->UnFreeBoundaryAspect()->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_UnFree));
|
||||
myDrawer->SeenLineAspect() ->SetWidth (AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Seen));
|
||||
myDrawer->LineAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) : 1.);
|
||||
myDrawer->WireAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Wire) : 1.);
|
||||
myDrawer->FreeBoundaryAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Free) : 1.);
|
||||
myDrawer->UnFreeBoundaryAspect()->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_UnFree) : 1.);
|
||||
myDrawer->SeenLineAspect() ->SetWidth (myDrawer->HasLink() ?
|
||||
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Seen) : 1.);
|
||||
}
|
||||
LoadRecomputable (AIS_WireFrame);
|
||||
}
|
||||
@@ -715,17 +763,20 @@ void AIS_Shape::UnsetWidth()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setMaterial (const Handle(AIS_Drawer)& theDrawer,
|
||||
void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Graphic3d_MaterialAspect& theMaterial,
|
||||
const Standard_Boolean theToKeepColor,
|
||||
const Standard_Boolean theToKeepTransp) const
|
||||
{
|
||||
const Quantity_Color aColor = theDrawer->ShadingAspect()->Material (myCurrentFacingModel).Color();
|
||||
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
||||
if (!theDrawer->HasShadingAspect())
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
|
||||
|
||||
@@ -805,8 +856,11 @@ void AIS_Shape::UnsetMaterial()
|
||||
if (HasColor()
|
||||
|| IsTransparent())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
|
||||
myCurrentFacingModel);
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetMaterial (myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel),
|
||||
myCurrentFacingModel);
|
||||
}
|
||||
if (HasColor())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetColor (myOwnColor, myCurrentFacingModel);
|
||||
@@ -851,13 +905,16 @@ void AIS_Shape::UnsetMaterial()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::setTransparency (const Handle(AIS_Drawer)& theDrawer,
|
||||
const Standard_Real theValue) const
|
||||
void AIS_Shape::setTransparency (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
const Standard_Real theValue) const
|
||||
{
|
||||
if (!theDrawer->HasShadingAspect())
|
||||
if (!theDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
theDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
if (theDrawer->HasLink())
|
||||
{
|
||||
*theDrawer->ShadingAspect()->Aspect() = *theDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
// override transparency
|
||||
@@ -910,7 +967,7 @@ void AIS_Shape::SetTransparency (const Standard_Real theValue)
|
||||
void AIS_Shape::UnsetTransparency()
|
||||
{
|
||||
myTransparency = 0.0;
|
||||
if (!myDrawer->HasShadingAspect())
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -996,7 +1053,7 @@ const Bnd_Box& AIS_Shape::BoundingBox()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnDeviationCoefficient();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnDeviationCoefficient();
|
||||
if(itSet) myDrawer->SetDeviationCoefficient();
|
||||
return itSet;
|
||||
}
|
||||
@@ -1009,7 +1066,7 @@ Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient ()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationCoefficient();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationCoefficient();
|
||||
if(itSet) myDrawer->SetHLRDeviationCoefficient();
|
||||
return itSet;
|
||||
|
||||
@@ -1023,7 +1080,7 @@ Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient ()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnDeviationAngle ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnDeviationAngle();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnDeviationAngle();
|
||||
if(itSet) myDrawer->SetDeviationAngle();
|
||||
return itSet;
|
||||
|
||||
@@ -1037,7 +1094,7 @@ Standard_Boolean AIS_Shape::SetOwnDeviationAngle ()
|
||||
|
||||
Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle ()
|
||||
{
|
||||
Standard_Boolean itSet = myDrawer->IsOwnHLRDeviationAngle();
|
||||
Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationAngle();
|
||||
if(itSet) myDrawer->SetHLRAngle();
|
||||
return itSet;
|
||||
|
||||
@@ -1138,7 +1195,7 @@ Standard_Boolean AIS_Shape::OwnDeviationCoefficient ( Standard_Real & aCoeffici
|
||||
{
|
||||
aCoefficient = myDrawer->DeviationCoefficient();
|
||||
aPreviousCoefficient = myDrawer->PreviousDeviationCoefficient ();
|
||||
return myDrawer->IsOwnDeviationCoefficient() ;
|
||||
return myDrawer->HasOwnDeviationCoefficient() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1151,7 +1208,7 @@ Standard_Boolean AIS_Shape::OwnHLRDeviationCoefficient ( Standard_Real & aCoeffi
|
||||
{
|
||||
aCoefficient = myDrawer->HLRDeviationCoefficient();
|
||||
aPreviousCoefficient = myDrawer->PreviousHLRDeviationCoefficient ();
|
||||
return myDrawer->IsOwnHLRDeviationCoefficient();
|
||||
return myDrawer->HasOwnHLRDeviationCoefficient();
|
||||
|
||||
}
|
||||
|
||||
@@ -1165,7 +1222,7 @@ Standard_Boolean AIS_Shape::OwnDeviationAngle ( Standard_Real & anAngle,
|
||||
{
|
||||
anAngle = myDrawer->DeviationAngle();
|
||||
aPreviousAngle = myDrawer->PreviousDeviationAngle ();
|
||||
return myDrawer->IsOwnDeviationAngle();
|
||||
return myDrawer->HasOwnDeviationAngle();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1178,5 +1235,5 @@ Standard_Boolean AIS_Shape::OwnHLRDeviationAngle ( Standard_Real & anAngle,
|
||||
{
|
||||
anAngle = myDrawer->HLRAngle();
|
||||
aPreviousAngle = myDrawer->PreviousHLRDeviationAngle ();
|
||||
return myDrawer->IsOwnHLRDeviationAngle();
|
||||
return myDrawer->HasOwnHLRDeviationAngle();
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
inline void AIS_Shape::Set(const TopoDS_Shape& ashap)
|
||||
{
|
||||
|
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <AIS_SymmetricRelation.ixx>
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
|
||||
#include <gce_MakeLin.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
|
@@ -15,7 +15,6 @@
|
||||
|
||||
#include <AIS_TexturedShape.hxx>
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
@@ -25,6 +24,7 @@
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
|
@@ -11,12 +11,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_Triangulation.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <Poly_Array1OfTriangle.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <TShort_Array1OfShortReal.hxx>
|
||||
|
@@ -32,7 +32,7 @@ class Trihedron from AIS inherits InteractiveObject from AIS
|
||||
-- dimensions, you must temporarily recover the Drawer.
|
||||
-- From inside it, you take the aspect in which the values
|
||||
-- for length are stocked. For trihedra, this is
|
||||
-- AIS_Drawer_FirstAxisAspect. You change the
|
||||
-- Prs3d_Drawer_FirstAxisAspect. You change the
|
||||
-- values inside this Aspect and recalculate the presentation.
|
||||
-- If you want to use extended selection modes, different than 0,
|
||||
-- you should take care of removing of the shapes from the interactive
|
||||
|
@@ -41,7 +41,6 @@
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_Plane.hxx>
|
||||
#include <AIS_Axis.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
@@ -118,7 +117,7 @@ void AIS_Trihedron::SetLocalTransformation (const gp_Trsf& theTransformation)
|
||||
void AIS_Trihedron::SetSize(const Standard_Real aValue)
|
||||
{
|
||||
myHasOwnSize = Standard_True;
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
myDrawer->SetDatumAspect(DA);
|
||||
}
|
||||
@@ -146,13 +145,16 @@ void AIS_Trihedron::UnsetSize()
|
||||
|
||||
myHasOwnSize = Standard_False;
|
||||
if(hasOwnColor){
|
||||
const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
|
||||
const Handle(Prs3d_DatumAspect) DA =
|
||||
myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() : new Prs3d_DatumAspect();
|
||||
myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
|
||||
DA->SecondAxisLength(),
|
||||
DA->ThirdAxisLength());
|
||||
}
|
||||
else
|
||||
myDrawer->DatumAspect().Nullify();
|
||||
{
|
||||
myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
|
||||
}
|
||||
Update();
|
||||
UpdateSelection();
|
||||
|
||||
@@ -165,15 +167,7 @@ void AIS_Trihedron::UnsetSize()
|
||||
|
||||
Standard_Real AIS_Trihedron::Size() const
|
||||
{
|
||||
if(myDrawer->HasDatumAspect()){
|
||||
myDrawer->Link()->DatumAspect(); // ? to ensure that myDrawer->myLink is not null for next call ?
|
||||
return myDrawer->DatumAspect()->FirstAxisLength();
|
||||
}
|
||||
else
|
||||
//return the Defaut value
|
||||
return 100. ;
|
||||
|
||||
|
||||
return myDrawer->DatumAspect()->FirstAxisLength();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -363,7 +357,7 @@ void AIS_Trihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelecti
|
||||
{
|
||||
// update AIS_Axis for selection
|
||||
Handle(AIS_Axis) anAxis = Handle(AIS_Axis)::DownCast(myShapes[anIdx]);
|
||||
Handle(AIS_Drawer) aDrawer = anAxis->Attributes();
|
||||
Handle(Prs3d_Drawer) aDrawer = anAxis->Attributes();
|
||||
Handle(Prs3d_DatumAspect) aDatum = myDrawer->DatumAspect();
|
||||
aDrawer->DatumAspect()->SetAxisLength (aDatum->FirstAxisLength(),
|
||||
aDatum->SecondAxisLength(),
|
||||
@@ -427,7 +421,7 @@ void AIS_Trihedron::SetColor(const Quantity_Color &aCol)
|
||||
hasOwnColor=Standard_True;
|
||||
myOwnColor = aCol;
|
||||
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
|
||||
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
|
||||
@@ -451,7 +445,7 @@ void AIS_Trihedron::SetTextColor(const Quantity_NameOfColor aCol)
|
||||
myHasOwnTextColor = Standard_True;
|
||||
myOwnTextColor = aCol;
|
||||
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
|
||||
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
|
||||
@@ -469,7 +463,7 @@ void AIS_Trihedron::SetArrowColor(const Quantity_NameOfColor aCol)
|
||||
myHasOwnArrowColor = Standard_True;
|
||||
myOwnArrowColor = aCol;
|
||||
|
||||
if(!myDrawer->HasDatumAspect()){
|
||||
if(!myDrawer->HasOwnDatumAspect()){
|
||||
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
|
||||
|
||||
DA->SetAxisLength(myDrawer->DatumAspect()->FirstAxisLength(),
|
||||
|
Reference in New Issue
Block a user