Open CASCADE Technology
6.5.4
|
A framework to manage presentation and selection of shapes.
AIS_Shape is the interactive object which is used the
most by applications. There are standard functions
available which allow you to prepare selection
operations on the constituent elements of shapes -
vertices, edges, faces etc - in an open local context.
The selection modes specific to "Shape" type objects
are referred to as Standard Activation Mode. These
modes are only taken into account in open local
context and only act on Interactive Objects which
have redefined the virtual method
AcceptShapeDecomposition so that it returns true.
Several advanced functions are also available. These
include functions to manage deviation angle and
deviation coefficient - both HLR and non-HLR - of
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
above deviation angle and coefficient functions return
true indicating that there is a local setting available
for the specific object.
#include <AIS_Shape.hxx>
Public Member Functions | |
AIS_Shape (const TopoDS_Shape &shap) | |
Initializes construction of the shape shap from wires, edges and vertices. | |
virtual Standard_Integer | Signature () const |
Returns index 0. This value refers to SHAPE from TopAbs_ShapeEnum | |
virtual AIS_KindOfInteractive | Type () const |
Returns Object as the type of Interactive Object. | |
virtual Standard_Boolean | AcceptShapeDecomposition () const |
Returns true if the Interactive Object accepts shape decomposition. | |
void | Set (const TopoDS_Shape &ashap) |
Constructs an instance of the shape object ashape. | |
const TopoDS_Shape & | Shape () const |
Returns this shape object. | |
Standard_Boolean | SetOwnDeviationCoefficient () |
Sets a local value for deviation coefficient for this specific shape. | |
Standard_Boolean | SetOwnHLRDeviationCoefficient () |
Sets a local value for HLR deviation coefficient for this specific shape. | |
Standard_Boolean | SetOwnDeviationAngle () |
Sets a local value for deviation angle for this specific shape. | |
Standard_Boolean | SetOwnHLRDeviationAngle () |
Sets a local value for HLR deviation angle for this specific shape. | |
void | SetOwnDeviationCoefficient (const Standard_Real aCoefficient) |
Sets a local value for deviation coefficient for this specific shape. | |
void | SetOwnHLRDeviationCoefficient (const Standard_Real aCoefficient) |
sets myOwnHLRDeviationCoefficient field in AIS_Drawer & recomputes presentation | |
void | SetAngleAndDeviation (const Standard_Real anAngle) |
this compute a new angle and Deviation from the value anAngle and set the values stored in myDrawer with these that become local to the shape | |
Standard_Real | UserAngle () const |
gives back the angle initial value put by the User. | |
void | SetOwnDeviationAngle (const Standard_Real anAngle) |
sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation | |
void | SetHLRAngleAndDeviation (const Standard_Real anAngle) |
this compute a new Angle and Deviation from the value anAngle for HLR and set the values stored in myDrawer for with these that become local to the shape | |
void | SetOwnHLRDeviationAngle (const Standard_Real anAngle) |
sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation | |
Standard_Boolean | OwnDeviationCoefficient (Standard_Real &aCoefficient, Standard_Real &aPreviousCoefficient) const |
Returns true and the values of the deviation coefficient aCoefficient and the previous deviation coefficient aPreviousCoefficient. If these values are not already set, false is returned. | |
Standard_Boolean | OwnHLRDeviationCoefficient (Standard_Real &aCoefficient, Standard_Real &aPreviousCoefficient) const |
Returns true and the values of the HLR deviation coefficient aCoefficient and the previous HLR deviation coefficient aPreviousCoefficient. If these values are not already set, false is returned. | |
Standard_Boolean | OwnDeviationAngle (Standard_Real &anAngle, Standard_Real &aPreviousAngle) const |
Returns true and the values of the deviation angle anAngle and the previous deviation angle aPreviousAngle. If these values are not already set, false is returned. | |
Standard_Boolean | OwnHLRDeviationAngle (Standard_Real &anAngle, Standard_Real &aPreviousAngle) const |
Returns true and the values of the HLR deviation angle anAngle and of the previous HLR deviation angle aPreviousAngle. If these values are not already set, false is returned. | |
virtual void | SetColor (const Quantity_NameOfColor aColor) |
Sets the color aColor in the reconstructed compound shape. Acts via the Drawer methods below on the appearance of: | |
virtual void | SetColor (const Quantity_Color &aColor) |
virtual void | UnsetColor () |
Removes settings for color in the reconstructed compound shape. | |
virtual void | SetWidth (const Standard_Real aValue) |
Sets the value aValue for line width in the reconstructed compound shape. | |
virtual void | UnsetWidth () |
Removes the setting for line width in the reconstructed compound shape. | |
virtual void | SetMaterial (const Graphic3d_NameOfMaterial aName) |
Sets the name aName for material defining this display attribute for the interactive object. Material aspect determines shading aspect, color and transparency of visible entities. | |
virtual void | SetMaterial (const Graphic3d_MaterialAspect &aName) |
Allows you to provide settings for the material aName in the reconstructed compound shape. | |
virtual void | UnsetMaterial () |
Removes settings for material in the reconstructed compound shape. | |
virtual void | SetTransparency (const Standard_Real aValue=0.6) |
Sets the value aValue for transparency in the reconstructed compound shape. | |
virtual void | UnsetTransparency () |
Removes the setting for transparency in the reconstructed compound shape. | |
virtual const Bnd_Box & | BoundingBox () |
Constructs a bounding box with which to reconstruct compound topological shapes for presentation. | |
virtual Quantity_NameOfColor | Color () const |
Returns the NameOfColor attributes of the shape accordingly to the current facing model; | |
virtual void | Color (Quantity_Color &aColor) const |
Returns the Color attributes of the shape accordingly to the current facing model; | |
virtual Graphic3d_NameOfMaterial | Material () const |
Returns the NameOfMaterial attributes of the shape accordingly to the current facing model; | |
virtual Standard_Real | Transparency () const |
Returns the transparency attributes of the shape accordingly to the current facing model; | |
Static Public Member Functions | |
static TopAbs_ShapeEnum | SelectionType (const Standard_Integer aDecompositionMode) |
Activates the same TopAbs shape enumerations as those used by SelectionMode assigning a type to the mode aDecompositionMode. | |
static Standard_Integer | SelectionMode (const TopAbs_ShapeEnum aShapeType) |
Establishes an equivalence between a mode and the type, aShapeType, of selection. The correspondences are as follows: | |
static Standard_Real | GetDeflection (const TopoDS_Shape &aShape, const Handle< Prs3d_Drawer > &aDrawer) |
Protected Member Functions | |
virtual void | Compute (const Handle< PrsMgr_PresentationManager3d > &aPresentationManager, const Handle< Prs3d_Presentation > &aPresentation, const Standard_Integer aMode=0) |
Calculates the 3D view aPresentation and its updates. The latter are managed by aPresentationManager. aPresentableObject has the display mode aMode; this has the default value of 0, that is, the wireframe display mode. | |
virtual void | Compute (const Handle< PrsMgr_PresentationManager2d > &aPresentationManager, const Handle< Graphic2d_GraphicObject > &aPresentation, const Standard_Integer aMode=0) |
Calculates the 2D view aPresentation and its updates. The latter are managed by aPresentationManager. aPresentableObject has the display mode aMode; this has the default value of 0, that is, the wireframe display mode. Note that this syntax is not used in AIS as that package only concerns 3D display. | |
virtual void | Compute (const Handle< Prs3d_Projector > &aProjector, const Handle< Prs3d_Presentation > &aPresentation) |
Calculates the 3D view aPresentation and its updates. The latter are managed by aPresentationManager. Each of the views in the viewer and every modification such as rotation, for example, entails recalculation. It must be redefined to implement hidden line removal for the object. The user never calls this method himself. This is done via the InteractiveContext object and is dependent on the point of view from which the object is displayed. | |
virtual void | Compute (const Handle< Prs3d_Projector > &aProjector, const Handle< Geom_Transformation > &aTrsf, const Handle< Prs3d_Presentation > &aPresentation) |
Calculates the 3D view aPresentation and its updates. The latter are managed by aPresentationManager. A point of view is provided by the projector aProjector, and the geometric transformation which has transformed associated presentable objects is specified by aTrsf. This function is to be used in case where a hidden line removal display cannot be calculated automatically. This occurs when associated presentable objects have been transformed geometrically, but not translated. Warning The transformation aTrsf must be applied to the object before computation. | |
virtual void | ComputeSelection (const Handle< SelectMgr_Selection > &aSelection, const Standard_Integer aMode) |
Recovers and calculates any sensitive primitive, aSelection, available in Shape mode, specified by aMode. As a rule, these are sensitive faces. This method is defined as virtual. This enables you to implement it in the creation of a new class of AIS Interactive Object. You need to do this and in so doing, redefine this method, if you create a class which enriches the list of signatures and types. | |
void | LoadRecomputable (const Standard_Integer TheMode) |
Static Protected Member Functions | |
static void | DisplayBox (const Handle< Prs3d_Presentation > &aPrs, const Bnd_Box &aBox, const Handle< Prs3d_Drawer > &aDrawer) |
Protected Attributes | |
TopoDS_Shape | myshape |
Bnd_Box | myBB |
Standard_Boolean | myCompBB |
AIS_Shape::AIS_Shape | ( | const TopoDS_Shape & | shap | ) |
virtual Standard_Boolean AIS_Shape::AcceptShapeDecomposition | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
virtual const Bnd_Box& AIS_Shape::BoundingBox | ( | ) | [virtual] |
virtual Quantity_NameOfColor AIS_Shape::Color | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
virtual void AIS_Shape::Color | ( | Quantity_Color & | aColor | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
virtual void AIS_Shape::Compute | ( | const Handle< PrsMgr_PresentationManager3d > & | aPresentationManager, |
const Handle< Prs3d_Presentation > & | aPresentation, | ||
const Standard_Integer | aMode = 0 |
||
) | [protected, virtual] |
Reimplemented from PrsMgr_PresentableObject.
Reimplemented in AIS_TexturedShape.
virtual void AIS_Shape::Compute | ( | const Handle< PrsMgr_PresentationManager2d > & | aPresentationManager, |
const Handle< Graphic2d_GraphicObject > & | aPresentation, | ||
const Standard_Integer | aMode = 0 |
||
) | [protected, virtual] |
Reimplemented from PrsMgr_PresentableObject.
virtual void AIS_Shape::Compute | ( | const Handle< Prs3d_Projector > & | aProjector, |
const Handle< Prs3d_Presentation > & | aPresentation | ||
) | [protected, virtual] |
Reimplemented from PrsMgr_PresentableObject.
virtual void AIS_Shape::Compute | ( | const Handle< Prs3d_Projector > & | aProjector, |
const Handle< Geom_Transformation > & | aTrsf, | ||
const Handle< Prs3d_Presentation > & | aPresentation | ||
) | [protected, virtual] |
Reimplemented from PrsMgr_PresentableObject.
virtual void AIS_Shape::ComputeSelection | ( | const Handle< SelectMgr_Selection > & | aSelection, |
const Standard_Integer | aMode | ||
) | [protected, virtual] |
Implements SelectMgr_SelectableObject.
static void AIS_Shape::DisplayBox | ( | const Handle< Prs3d_Presentation > & | aPrs, |
const Bnd_Box & | aBox, | ||
const Handle< Prs3d_Drawer > & | aDrawer | ||
) | [static, protected] |
static Standard_Real AIS_Shape::GetDeflection | ( | const TopoDS_Shape & | aShape, |
const Handle< Prs3d_Drawer > & | aDrawer | ||
) | [static] |
void AIS_Shape::LoadRecomputable | ( | const Standard_Integer | TheMode | ) | [protected] |
virtual Graphic3d_NameOfMaterial AIS_Shape::Material | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
Standard_Boolean AIS_Shape::OwnDeviationAngle | ( | Standard_Real & | anAngle, |
Standard_Real & | aPreviousAngle | ||
) | const |
Standard_Boolean AIS_Shape::OwnDeviationCoefficient | ( | Standard_Real & | aCoefficient, |
Standard_Real & | aPreviousCoefficient | ||
) | const |
Standard_Boolean AIS_Shape::OwnHLRDeviationAngle | ( | Standard_Real & | anAngle, |
Standard_Real & | aPreviousAngle | ||
) | const |
Standard_Boolean AIS_Shape::OwnHLRDeviationCoefficient | ( | Standard_Real & | aCoefficient, |
Standard_Real & | aPreviousCoefficient | ||
) | const |
static Standard_Integer AIS_Shape::SelectionMode | ( | const TopAbs_ShapeEnum | aShapeType | ) | [static] |
static TopAbs_ShapeEnum AIS_Shape::SelectionType | ( | const Standard_Integer | aDecompositionMode | ) | [static] |
void AIS_Shape::Set | ( | const TopoDS_Shape & | ashap | ) |
void AIS_Shape::SetAngleAndDeviation | ( | const Standard_Real | anAngle | ) |
virtual void AIS_Shape::SetColor | ( | const Quantity_NameOfColor | aColor | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
virtual void AIS_Shape::SetColor | ( | const Quantity_Color & | aColor | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in XCAFPrs_AISObject.
void AIS_Shape::SetHLRAngleAndDeviation | ( | const Standard_Real | anAngle | ) |
virtual void AIS_Shape::SetMaterial | ( | const Graphic3d_NameOfMaterial | aName | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in XCAFPrs_AISObject.
virtual void AIS_Shape::SetMaterial | ( | const Graphic3d_MaterialAspect & | aName | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in XCAFPrs_AISObject.
void AIS_Shape::SetOwnDeviationAngle | ( | const Standard_Real | anAngle | ) |
void AIS_Shape::SetOwnDeviationCoefficient | ( | const Standard_Real | aCoefficient | ) |
void AIS_Shape::SetOwnHLRDeviationAngle | ( | const Standard_Real | anAngle | ) |
void AIS_Shape::SetOwnHLRDeviationCoefficient | ( | const Standard_Real | aCoefficient | ) |
virtual void AIS_Shape::SetTransparency | ( | const Standard_Real | aValue = 0.6 | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in XCAFPrs_AISObject.
virtual void AIS_Shape::SetWidth | ( | const Standard_Real | aValue | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
const TopoDS_Shape& AIS_Shape::Shape | ( | ) | const |
virtual Standard_Integer AIS_Shape::Signature | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
virtual Standard_Real AIS_Shape::Transparency | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
virtual AIS_KindOfInteractive AIS_Shape::Type | ( | ) | const [virtual] |
Reimplemented from AIS_InteractiveObject.
virtual void AIS_Shape::UnsetColor | ( | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in XCAFPrs_AISObject.
virtual void AIS_Shape::UnsetMaterial | ( | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in XCAFPrs_AISObject.
virtual void AIS_Shape::UnsetTransparency | ( | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Reimplemented in XCAFPrs_AISObject.
virtual void AIS_Shape::UnsetWidth | ( | ) | [virtual] |
Reimplemented from AIS_InteractiveObject.
Standard_Real AIS_Shape::UserAngle | ( | ) | const |
Bnd_Box AIS_Shape::myBB [protected] |
Standard_Boolean AIS_Shape::myCompBB [protected] |
TopoDS_Shape AIS_Shape::myshape [protected] |