Open CASCADE Technology 6.6.0
Public Member Functions
Visual3d_Layer Class Reference

This class allows to manage 2d graphics.

#include <Visual3d_Layer.hxx>

Inheritance diagram for Visual3d_Layer:
Inheritance graph
[legend]

Public Member Functions

 Visual3d_Layer (const Handle< Visual3d_ViewManager > &AViewer, const Aspect_TypeOfLayer AType=Aspect_TOL_OVERLAY, const Standard_Boolean AFlag=Standard_False)
 Creates a layer with the type <Atype>.
if <AFlag> == Standard_True then the layer is
"size dependent".
The mapping of the layer is dependent of each
window's size.
if <AFlag> == Standard_False then the mapping of the
layer is dependent of the highest window and the largest
window of all the views of the viewer <AViewer>.
When the viewer <AViewer> have only one view, the
result will be the same with <AFlag> == Standard_False
or <AFlag> == Standard_True.

void Destroy ()
 Suppress the layer <me>.

 ~Visual3d_Layer ()
void Begin ()
 Begins the definition of the layer <me>
Warning: No default attributes

void End ()
 Finishs the definition of the layer <me>.

void Clear ()
 Clear all graphics managed by the layer <me>.

void BeginPolyline ()
 After this call, <me> is ready to receive
a definition of a polyline with AddVertex().

void BeginPolygon ()
 After this call, <me> is ready to receive
a definition of a polygon with AddEdge().

void AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Boolean AFlag=Standard_True)
 Puts <X, Y> as a new point in the current primitive.
If <AFlag> then it is a draw between last point and
this point else it is a move between last point and
this point.

void ClosePrimitive ()
 After this call, <me> stops the reception of
a definition of a Begin... primitive.

void DrawRectangle (const Standard_Real X, const Standard_Real Y, const Standard_Real Width, const Standard_Real Height)
 Draws the rectangle at position <X,Y>.

void DrawText (const Standard_CString AText, const Standard_Real X, const Standard_Real Y, const Standard_Real AHeight)
 Draws the string <AText> at position <X,Y>.
The attributes are given with respect to the plane of
projection.
<AHeight> : Height of text.
(Relative to the Normalized Projection
Coordinates (NPC) Space).

void TextSize (const Standard_CString AText, const Standard_Real AHeight, Standard_Real &AWidth, Standard_Real &AnAscent, Standard_Real &ADescent) const
 Get the size of text.
The attributes are given with respect to the plane of
projection.
<AHeight> : Height of text.
(Relative to the Normalized Projection
Coordinates (NPC) Space).

void SetColor (const Quantity_Color &AColor)
 Modifies the current color.
Warning: No default color

void SetTransparency (const Standard_ShortReal ATransparency)
 Modifies the current transparency.
Warning: No default transparency

void UnsetTransparency ()
 Unsets the transparency.

void SetLineAttributes (const Aspect_TypeOfLine AType, const Standard_Real AWidth)
 Modifies the current lines attributes.
Warning: No default attributes

void SetTextAttributes (const Standard_CString AFont, const Aspect_TypeOfDisplayText AType, const Quantity_Color &AColor)
 Modifies the current texts attributes.
<AFont> defines the name of the font to be used.
<AType> defines the display type of the text.
<AColor> defines the color of decal or subtitle background.
To set the color of the text you can use the SetColor method.
Warning: No default attributes

void SetOrtho (const Standard_Real Left, const Standard_Real Right, const Standard_Real Bottom, const Standard_Real Top, const Aspect_TypeOfConstraint Attach=Aspect_TOC_BOTTOM_LEFT)
 Modifies the current coordinates system of the layer <me>.

void SetViewport (const Standard_Integer Width, const Standard_Integer Height)
 Modifies the current viewport of the layer <me>.

Aspect_CLayer2d CLayer () const
 Returns the associated C structure.

Aspect_TypeOfLayer Type () const
 Returns the type.

void AddLayerItem (const Handle< Visual3d_LayerItem > &Item)
void RemoveLayerItem (const Handle< Visual3d_LayerItem > &Item)
void RemoveAllLayerItems ()
const Visual3d_NListOfLayerItem & GetLayerItemList () const
void RenderLayerItems () const

Constructor & Destructor Documentation

Visual3d_Layer::Visual3d_Layer ( const Handle< Visual3d_ViewManager > &  AViewer,
const Aspect_TypeOfLayer  AType = Aspect_TOL_OVERLAY,
const Standard_Boolean  AFlag = Standard_False 
)
Visual3d_Layer::~Visual3d_Layer ( ) [inline]

Member Function Documentation

void Visual3d_Layer::AddLayerItem ( const Handle< Visual3d_LayerItem > &  Item)
void Visual3d_Layer::AddVertex ( const Standard_Real  X,
const Standard_Real  Y,
const Standard_Boolean  AFlag = Standard_True 
)
void Visual3d_Layer::Begin ( )
void Visual3d_Layer::BeginPolygon ( )
void Visual3d_Layer::BeginPolyline ( )
Aspect_CLayer2d Visual3d_Layer::CLayer ( ) const
void Visual3d_Layer::Clear ( )
void Visual3d_Layer::ClosePrimitive ( )
void Visual3d_Layer::Destroy ( )
void Visual3d_Layer::DrawRectangle ( const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  Width,
const Standard_Real  Height 
)
void Visual3d_Layer::DrawText ( const Standard_CString  AText,
const Standard_Real  X,
const Standard_Real  Y,
const Standard_Real  AHeight 
)
void Visual3d_Layer::End ( )
const Visual3d_NListOfLayerItem& Visual3d_Layer::GetLayerItemList ( ) const
void Visual3d_Layer::RemoveAllLayerItems ( )
void Visual3d_Layer::RemoveLayerItem ( const Handle< Visual3d_LayerItem > &  Item)
void Visual3d_Layer::RenderLayerItems ( ) const
void Visual3d_Layer::SetColor ( const Quantity_Color AColor)
void Visual3d_Layer::SetLineAttributes ( const Aspect_TypeOfLine  AType,
const Standard_Real  AWidth 
)
void Visual3d_Layer::SetOrtho ( const Standard_Real  Left,
const Standard_Real  Right,
const Standard_Real  Bottom,
const Standard_Real  Top,
const Aspect_TypeOfConstraint  Attach = Aspect_TOC_BOTTOM_LEFT 
)
void Visual3d_Layer::SetTextAttributes ( const Standard_CString  AFont,
const Aspect_TypeOfDisplayText  AType,
const Quantity_Color AColor 
)
void Visual3d_Layer::SetTransparency ( const Standard_ShortReal  ATransparency)
void Visual3d_Layer::SetViewport ( const Standard_Integer  Width,
const Standard_Integer  Height 
)
void Visual3d_Layer::TextSize ( const Standard_CString  AText,
const Standard_Real  AHeight,
Standard_Real AWidth,
Standard_Real AnAscent,
Standard_Real ADescent 
) const
Aspect_TypeOfLayer Visual3d_Layer::Type ( ) const
void Visual3d_Layer::UnsetTransparency ( )

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines