All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

VisualizationBase Class CATRender

CATRender
 

Usage: you must use this class as is. You should never derive it.


public class CATRender

Class to create a render.
Role: The CATRender and inherited objects are the classes defining actions on graphical representations and graphical primitives. The renders are the only objects directly connected to the representations and to the primitives through their Draw methods. Mainly, the CATRender inherited objects are used to descend a representation tree from the top to the bottom. Render methods are overloaded in order to pick up information from the representation tree defining the graphical database. The CATRender is called each time a Draw is performed. With the following list of methods, it's made possible to extract any information from the graphical database:

  1. Push/Pop Matrix: Gives the tree architecture.
  2. DrawRepresentation: Gives the starting point for the draw of a rep.
  3. Draw xxx: Gives information on the type of the graphical primitive that is being drawn.
Note that all these functions are sequentially called, so it's always possible to build back the list of what is being drawn and the order of the draw sequence. It'll never be possible to know exactly which type of representation is being drawn, because representations are an open class, and no application may have the knowledge of all of them.


Constructor and Destructor Index


o CATRender(CATSupport&)
Constructs a render.
o ~CATRender()
Destructor

Method Index


o Draw2DArcCircle(CAT2DArcCircleGP&)
Draws a 2D arc's circle.
o Draw2DArcEllipse(CAT2DArcEllipseGP&)
Draws a 2D arc's ellipse.
o Draw2DGeometricText(CAT2DGeometricTextGP&)
Draws a 2D geometric text.
o Draw2DLine(CAT2DLineGP&)
Draws a 2D line.
o Draw2DMarker(CAT2DMarkerGP&)
Draws a 2D marker.
o Draw2DPolygon(CAT2DPolygonGP&)
Draws a 2D polygon.
o Draw2DQuadStrip(CAT2DQuadStripGP&)
Draws a 2D quad strip.
o Draw2DRectangle(CAT2DRectangleGP&)
Draws a 2D rectangle.
o Draw3DCurvedPipe(CAT3DCurvedPipeGP&)
Draws a 3D curved pipe.
o Draw3DCylinder(CAT3DCylinderGP&,int)
Draws a 3D cylinder.
o Draw3DEdge(CAT3DEdgeGP&)
Draws a 3D edge.
o Draw3DFace(CAT3DFaceGP&)
Draws a 3D face.
o Draw3DLine(CAT3DLineGP&)
Draws a 3D line.
o Draw3DMarker(CAT3DMarkerGP&)
Draws a 3D marker.
o Draw3DPlanarFace(CAT3DPlanarFaceGP&)
Draws a 3D planar face.
o DrawDynamicGP(CATDynamicGP&)
Draws a dynamic graphic primitive.
o DrawLightSource(CAT3DLightSourceGP&)
Draws a 3D light source.
o DrawRepresentation(CATRep&)
Draws a representation.
o DrawRepresentation(CATRep&,int,void*&)
This method is called at the begining of a Rep draw.
o EndDrawRepresentation(CATRep&,void*&)
This method is called at the end of a Rep draw.
o Get3DViewpoint()
Gets the render's 3D Viewpoint.
o GetCATColorMap()
Gets the render's CATColorMap.
o GetMMFromModelRatio()
Get the mm size in model unit for 2D.
o GetMMFromModelRatio(CATMathPointf&)
Get the mm size in model unit for a 3D point.
o GetMMInSupportUnit()
Get the mm size in pixel.
o GetPixelFromModelRatio()
Get the pixel size in model unit for 2D.
o GetPixelFromModelRatio(CATMathPointf&)
Get the pixel size in model unit for a 3D point.
o GetPixelRatioWH()
Get the pixel's ratio height/weight.
o GetSupport()
Gets the render's Support.
o GetWidthAndHeight(float&,float&)
Get the support's width and height.
o IsDrawable(CATGraphicAttributeSet&)
Indicates if the representation is drawable with this attribut.
o IsDrawable(CATGraphicAttributeSet&,CAT2DBoundingBox&,CATRep&)
Indicates if the representation is drawable with this attribut and this bounding box.
o IsDrawable(CATGraphicAttributeSet&,CAT2DBoundingBox&,int)
Indicates if the representation is drawable with this attribut and this bounding box.
o IsDrawable(CATGraphicAttributeSet&,CAT3DBoundingSphere&,CATRep&,CATGraphicMaterial*)
Indicates if the representation is drawable with this attribut and this bounding sphere.
o IsDrawable(CATGraphicAttributeSet&,CAT3DBoundingSphere&,int)
Indicates if the representation is drawable with this attribut and this bounding sphere.
o IsDrawable(CATGraphicAttributeSet&,CATGraphicMaterial*)
Indicates if the representation is drawable with this attribut.
o IsDrawable(CATGraphicAttributeSet&,CATRep&,CATGraphicMaterial*)
Indicates if the representation is drawable with this attribut.
o IsDrawable(CATGraphicAttributeSet&,int)
Indicates if the representation is drawable with this attribut.
o IsDrawable(CATGraphicAttributeSet&,int,int)
Indicates if the representation is drawable with this attribut.
o IsDrawable(CATGraphicAttributeSet&,list<int>&)
Indicates if the representation is drawable with this attribut.
o IsDrawable(CATGraphicAttributeSet&,list<int>&,int)
Indicates if the representation is drawable with this attribut.
o PopMatrix(CATRender*)
Pop a matrix.
o PushMatrix(CAT3x3Matrix&)
Push the 2D matrix.
o PushMatrix(CAT4x4Matrix&)
Push the 3D matrix.
o SetViewMode(int,int)
Sets the render's view mode.
o ViewMode(int)
Gets the render's current view mode.

Constructor and Destructor


o CATRender
public CATRender( const CATSupport& iSupport)
Constructs a render.
Parameters:
iSupport
The
CATSupport.
o ~CATRender
public virtual ~CATRender()
Destructor

Methods


o Draw2DArcCircle
public virtual void Draw2DArcCircle(CAT2DArcCircleGP& iGP)
Draws a 2D arc's circle.
Parameters:
iGP
The
CAT2DArcCircleGP to draw.
o Draw2DArcEllipse
public virtual void Draw2DArcEllipse(CAT2DArcEllipseGP& iGP)
Draws a 2D arc's ellipse.
Parameters:
iGP
The
CAT2DArcEllipseGP to draw.
o Draw2DGeometricText
public virtual void Draw2DGeometricText(CAT2DGeometricTextGP& iGP)
Draws a 2D geometric text.
Parameters:
iGP
The
CAT2DGeometricTextGP to draw.
o Draw2DLine
public virtual void Draw2DLine(CAT2DLineGP& iGP)
Draws a 2D line.
Parameters:
iGP
The
CAT2DLineGP to draw.
o Draw2DMarker
public virtual void Draw2DMarker(CAT2DMarkerGP& iGP)
Draws a 2D marker.
Parameters:
iGP
The
CAT2DMarkerGP to draw.
o Draw2DPolygon
public virtual void Draw2DPolygon(CAT2DPolygonGP& iGP)
Draws a 2D polygon.
Parameters:
iGP
The
CAT2DPolygonGP to draw.
o Draw2DQuadStrip
public virtual void Draw2DQuadStrip(CAT2DQuadStripGP& iGP)
Draws a 2D quad strip.
Parameters:
iGP
The
CAT2DQuadStripGP to draw.
o Draw2DRectangle
public virtual void Draw2DRectangle(CAT2DRectangleGP& iGP)
Draws a 2D rectangle.
Parameters:
iGP
The
CAT2DRectangleGP to draw.
o Draw3DCurvedPipe
public virtual void Draw3DCurvedPipe(CAT3DCurvedPipeGP& iGP)
Draws a 3D curved pipe.
Parameters:
iGP
The
CAT3DCurvedPipeGP to draw.
o Draw3DCylinder
public virtual void Draw3DCylinder(CAT3DCylinderGP& iGP,
const int = 0)
Draws a 3D cylinder.
Parameters:
iGP
The
CAT3DCylinderGP to draw.
o Draw3DEdge
public virtual void Draw3DEdge(CAT3DEdgeGP& iGP)
Draws a 3D edge.
Parameters:
iGP
The
CAT3DEdgeGP to draw.
o Draw3DFace
public virtual void Draw3DFace(CAT3DFaceGP& iGP)
Draws a 3D face.
Parameters:
iGP
The
CAT3DFaceGP to draw.
o Draw3DLine
public virtual void Draw3DLine(CAT3DLineGP& iGP)
Draws a 3D line.
Parameters:
iGP
The
CAT3DLineGP to draw.
o Draw3DMarker
public virtual void Draw3DMarker(CAT3DMarkerGP& iGP)
Draws a 3D marker.
Parameters:
iGP
The
CAT3DMarkerGP to draw.
o Draw3DPlanarFace
public virtual void Draw3DPlanarFace(CAT3DPlanarFaceGP& iGP)
Draws a 3D planar face.
Parameters:
iGP
The
CAT3DPlanarFaceGP to draw.
o DrawDynamicGP
public virtual void DrawDynamicGP(CATDynamicGP& iGP)
Draws a dynamic graphic primitive.
Parameters:
iGP
The
CATDynamicGP to draw.
o DrawLightSource
public virtual void DrawLightSource(CAT3DLightSourceGP& iGP)
Draws a 3D light source.
Parameters:
iGP
The
CAT3DLightSourceGP to draw.
o DrawRepresentation
public virtual void DrawRepresentation(CATRep& iRep)
Draws a representation.
Parameters:
iRep
The representation to draw.
o DrawRepresentation
public virtual int DrawRepresentation(CATRep& iRep,
int iInside,
void*& iData)
This method is called at the begining of a Rep draw. You can overload it to get in your code before the rep is drawn. You must return 1 if you want the DrawShading to be done.
Parameters:
iRep
The Rep which is going to be drawn.
iInside
iData
A pointer to the data you want to pass from DrawRep to EndDrawRep
o EndDrawRepresentation
public virtual int EndDrawRepresentation(CATRep& iRep,
void*& iData)
This method is called at the end of a Rep draw. Return 1 if evrything's ok
Parameters:
iRep
The Rep which has been drawn.
iData
A pointer to the data you want to pass from DrawRep to EndDrawRep
o Get3DViewpoint
public virtual CAT3DViewpoint * Get3DViewpoint()const
Gets the render's 3D Viewpoint.
Returns:
The pointer to the 3D viewpoint.
o GetCATColorMap
public inline CATColorMap * GetCATColorMap()
Gets the render's CATColorMap.
Returns:
The pointer to the color map.
o GetMMFromModelRatio
public float GetMMFromModelRatio()const
Get the mm size in model unit for 2D.
Returns:
The mm size in model unit.
o GetMMFromModelRatio
public float GetMMFromModelRatio( const CATMathPointf& iPoint) const
Get the mm size in model unit for a 3D point.
Parameters:
iPoint
The 3D point where the size is calculated.
Returns:
The mm size in model unit.
o GetMMInSupportUnit
public inline float GetMMInSupportUnit()const
Get the mm size in pixel.
Returns:
The mm size in pixel.
o GetPixelFromModelRatio
public float GetPixelFromModelRatio()const
Get the pixel size in model unit for 2D.
Returns:
The pixel size in model unit.
o GetPixelFromModelRatio
public float GetPixelFromModelRatio( const CATMathPointf& iPoint) const
Get the pixel size in model unit for a 3D point.
Parameters:
iPoint
The 3D point where the size is calculated.
Returns:
The pixel size in model unit.
o GetPixelRatioWH
public inline float GetPixelRatioWH()const
Get the pixel's ratio height/weight.
Returns:
The pixel's ratio.
o GetSupport
public inline CATSupport* GetSupport()
Gets the render's Support.
Returns:
The pointer to the support.
o GetWidthAndHeight
public inline void GetWidthAndHeight(float& oWidth,
float& oHeight)const
Get the support's width and height.
Parameters:
oWidth
The returned width.
oHeight
The returned height.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& )
Indicates if the representation is drawable with this attribut.
Parameters:
iAttribut
The representation's attributes.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const CAT2DBoundingBox& iBoundinBox,
const CATRep& iRep)
Indicates if the representation is drawable with this attribut and this bounding box.
Parameters:
iAttribut
The representation's attributes.
iBoundingBox
The representation's 2D bounding box.
iRep
The representation.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const CAT2DBoundingBox& iBoundingBox,
const int iSubElementId)
Indicates if the representation is drawable with this attribut and this bounding box.
Parameters:
iAttribut
The representation's attributes.
iBoundingBox
The representation's 2D bounding box.
iSubElementId.
The representation's sub-element identificator.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const CAT3DBoundingSphere& iBoundingSphere,
const CATRep& iRep,
CATGraphicMaterial* iMaterial= 0)
Indicates if the representation is drawable with this attribut and this bounding sphere.
Parameters:
iAttribut
The representation's attributes.
iBoundingSphere
The representation's 3D bounding sphere.
iRep.
The representation.
iMaterial
The material to be load.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const CAT3DBoundingSphere& iBoundingSphere,
const int iSubElementId)
Indicates if the representation is drawable with this attribut and this bounding sphere.
Parameters:
iAttribut
The representation's attributes.
iBoundingSphere
The representation's 3D bounding sphere.
iSubElementId.
The representation's sub-element identificator.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
CATGraphicMaterial* iMaterial)
Indicates if the representation is drawable with this attribut.
Parameters:
iAttribut
The representation's attributes.
iMaterial
The material to be load.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const CATRep& iRep,
CATGraphicMaterial* iMaterial= 0)
Indicates if the representation is drawable with this attribut.
Parameters:
iAttribut
The representation's attributes.
iRep.
The representation.
iMaterial
The material to be load.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const int iSubElementId)
Indicates if the representation is drawable with this attribut.
Parameters:
iAttribut
The representation's attributes.
iSubElementId.
The representation's sub-element identificator.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const int iSubElementId,
const int iType)
Indicates if the representation is drawable with this attribut.
Parameters:
iAttribut
The representation's attributes.
iSubElementId.
The representation's sub-element identificator.
iType.
Flag to update the type of representation.
Legal values:
  1. 0: the type is not updated.
  2. 1: the type is updated.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const list<int>& ipSubElementIdList)
Indicates if the representation is drawable with this attribut.
Parameters:
iAttribut
The representation's attributes.
ipSubElementIdList.
The representation's sub-elements identificators.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o IsDrawable
public virtual int IsDrawable( const CATGraphicAttributeSet& iAttribut,
const list<int>& ipSubElementIdList,
const int iType)
Indicates if the representation is drawable with this attribut.
Parameters:
iAttribut
The representation's attributes.
iSubElementId.
The representation's sub-elements identificators.
iType.
Flag to update the type of representation.
Legal values:
  1. 0: the type is not updated.
  2. 1: the type is updated.
Returns:

Legal values:
  1. 0: the representation is not drawable.
  2. 1: the representation is drawable.
o PopMatrix
public virtual void PopMatrix(CATRender* ioRender)
Pop a matrix.
Parameters:
ioRender
The render created by PushMatrix to delete.
o PushMatrix
public virtual CATRender * PushMatrix(CAT3x3Matrix& iMatrix)
Push the 2D matrix.
Parameters:
iMatrix
The 2D matrix to apply.
Returns:
The pointer to the new render.
o PushMatrix
public virtual CATRender * PushMatrix(CAT4x4Matrix& iMatrix)
Push the 3D matrix.
Parameters:
iMatrix
The 3D matrix to apply.
Returns:
The pointer to the new render.
o SetViewMode
public inline void SetViewMode( const int iViewMode,
const int iActive)
Sets the render's view mode.
Parameters:
iViewMode
The view mode. @see CATViewerUtility.
iActive

Legal values:
  1. 0 : the view is inactivated
  2. 1 : the view is activated
o ViewMode
public virtual int ViewMode( const int oViewMode) const
Gets the render's current view mode.
Parameters:
oViewMode
The returned view mode.

This object is included in the file: CATRender.h
If needed, your Imakefile.mk should include the module: CATViz

Copyright © 2003, Dassault Systèmes. All rights reserved.