Open CASCADE Technology: Visual3d_Layer Class Reference

Open CASCADE Technology 6.9.1

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions
Visual3d_Layer Class Reference

This class allows to manage 2d graphics. More...

`#include <Visual3d_Layer.hxx>`

Inheritance diagram for Visual3d_Layer:
[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. More...
void | Destroy ()
| Suppress the layer <me>. More...
| ~Visual3d_Layer ()
void | Begin ()
| Begins the definition of the layer <me> Warning: No default attributes. More...
void | End ()
| Finishs the definition of the layer <me>. More...
void | Clear ()
| Clear all graphics managed by the layer <me>. More...
void | BeginPolyline ()
| After this call, <me> is ready to receive a definition of a polyline with AddVertex(). More...
void | BeginPolygon ()
| After this call, <me> is ready to receive a definition of a polygon with AddEdge(). More...
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. More...
void | ClosePrimitive ()
| After this call, <me> stops the reception of a definition of a Begin... primitive. More...
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>. More...
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). More...
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). More...
void | SetColor (const Quantity_Color &AColor)
| Modifies the current color. Warning: No default color. More...
void | SetTransparency (const Standard_ShortReal ATransparency)
| Modifies the current transparency. Warning: No default transparency. More...
void | UnsetTransparency ()
| Unsets the transparency. More...
void | SetLineAttributes (const Aspect_TypeOfLine AType, const Standard_Real AWidth)
| Modifies the current lines attributes. Warning: No default attributes. More...
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. More...
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>. More...
void | SetViewport (const Standard_Integer Width, const Standard_Integer Height)
| Modifies the current viewport of the layer <me>. More...
Aspect_CLayer2d | CLayer () const
| Returns the associated C structure. More...
Aspect_TypeOfLayer | Type () const
| Returns the type. More...
void | AddLayerItem (const Handle< Visual3d_LayerItem > &Item)
void | RemoveLayerItem (const Handle< Visual3d_LayerItem > &Item)
void | RemoveAllLayerItems ()
const Visual3d_NListOfLayerItem & | GetLayerItemList () const
void | RenderLayerItems () const
Public Member Functions inherited from MMgt_TShared
virtual void | Delete () const
| Memory deallocator for transient classes. More...
Public Member Functions inherited from Standard_Transient
| Standard_Transient ()
| Empty constructor. More...
| Standard_Transient (const Standard_Transient &)
| Copy constructor – does nothing. More...
Standard_Transient & | operator= (const Standard_Transient &)
| Assignment operator, needed to avoid copying reference counter. More...
virtual | ~Standard_Transient ()
| Destructor must be virtual. More...
virtual const Handle_Standard_Type & | DynamicType () const
| Returns a type information object about this object. More...
Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const
| Returns a true value if this is an instance of Type. More...
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const
| Returns a true value if this is an instance of TypeName. More...
Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
Standard_Boolean | IsKind (const Standard_CString theTypeName) const
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
virtual Handle_Standard_Transient | This () const
| Returns a Handle which references this object. Must never be called to objects created in stack. More...
Standard_Integer | GetRefCount () const
| Get the reference counter of this object. More...

## Detailed Description

This class allows to manage 2d graphics.

## 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`
| ) |  |

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.

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`
| ) |  |

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 Visual3d_Layer::Begin | ( |  | ) |

Begins the definition of the layer <me> Warning: No default attributes.

void Visual3d_Layer::BeginPolygon | ( |  | ) |

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

void Visual3d_Layer::BeginPolyline | ( |  | ) |

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

Aspect_CLayer2d Visual3d_Layer::CLayer | ( |  | ) | const

Returns the associated C structure.

void Visual3d_Layer::Clear | ( |  | ) |

Clear all graphics managed by the layer <me>.

void Visual3d_Layer::ClosePrimitive | ( |  | ) |

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

void Visual3d_Layer::Destroy | ( |  | ) |

Suppress the layer <me>.

void Visual3d_Layer::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 Visual3d_Layer::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 Visual3d_Layer::End | ( |  | ) |

Finishs the definition of the layer <me>.

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 | ) |

Modifies the current color. Warning: No default color.

void Visual3d_Layer::SetLineAttributes | ( | const Aspect_TypeOfLine | AType,
|  | const Standard_Real | AWidth
| ) |  |

Modifies the current lines attributes. Warning: No default attributes.

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`
| ) |  |

Modifies the current coordinates system of the layer <me>.

void Visual3d_Layer::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 Visual3d_Layer::SetTransparency | ( | const Standard_ShortReal | ATransparency | ) |

Modifies the current transparency. Warning: No default transparency.

void Visual3d_Layer::SetViewport | ( | const Standard_Integer | Width,
|  | const Standard_Integer | Height
| ) |  |

Modifies the current viewport of the layer <me>.

void Visual3d_Layer::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).

Aspect_TypeOfLayer Visual3d_Layer::Type | ( |  | ) | const

Returns the type.

void Visual3d_Layer::UnsetTransparency | ( |  | ) |

Unsets the transparency.

The documentation for this class was generated from the following file:

- Visual3d_Layer.hxx