TexGen
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TexGen::CTexGenRenderer Class Reference

Used for rendering stuff using VTK http://www.vtk.org/. More...

#include <TexGenRenderer.h>

Public Types

enum  PROP_TYPE {
  PROP_NODE , PROP_PATH , PROP_SURFACE , PROP_VOLUME ,
  PROP_AXES , PROP_INTERFERENCE , PROP_ORIENTATION , PROP_DOMAIN ,
  PROP_DOMAINAXES , PROP_IMAGE , PROP_INTERFERENCE_DEPTH
}
 
enum  EXPORT_FLAG { EXPORT_NODES = 1<<0 , EXPORT_PATH = 1<<1 , EXPORT_SURFACE = 1<<2 , EXPORT_DOMAIN = 1<<3 }
 

Public Member Functions

 CTexGenRenderer (vtkRenderWindowInteractor *pRenderWindowInteractor=NULL)
 
 ~CTexGenRenderer (void)
 
void RenderTextile (string TextileName="", double dOpacity=1)
 Create the mesh and add it to the scene to be rendered. More...
 
void RenderTextile (CTextile &Textile, double dOpacity=1)
 Create the mesh and add it to the scene to be rendered. More...
 
vtkProp * RenderYarn (CYarn &Yarn, const CDomain *pDomain=NULL, COLOR Color=COLOR(1, 1, 1), double dOpacity=1)
 Render a single yarn with given color. More...
 
void RenderMesh (string TextileName="")
 Create the volume mesh and add it to the scene to be rendered. More...
 
void RenderMesh (CTextile &Textile)
 Create the volume mesh and add it to the scene to be rendered. More...
 
vtkProp * RenderYarnMesh (CYarn &Yarn, const CDomain *pDomain=NULL, COLOR Color=COLOR(1, 1, 1))
 Render a single yarn mesh with given color. More...
 
void RenderDomain (string TextileName="", COLOR Color=COLOR(1, 1, 1), double dOpacity=0.5)
 Render the domain. More...
 
void RenderDomain (const CDomain &Domain, COLOR Color=COLOR(1, 1, 1), double dOpacity=0.5)
 Render the domain. More...
 
void RenderDomainAxes (string TextileName="")
 Render the dimensions of the domain. More...
 
void RenderDomainAxes (const CDomain &Domain)
 Render the dimensions of the domain. More...
 
void RenderNodes (string TextileName="")
 Render all the master nodes of each yarn in a textile. More...
 
void RenderNodes (CTextile &Textile)
 Render all the master nodes of each yarn in a textile. More...
 
void RenderNodes (CTextile &Textile, int iYarn)
 Render all the master nodes of each yarn in a textile. More...
 
void RenderPaths (string TextileName="")
 Render the paths of each yarn in a textile. More...
 
void RenderPaths (CTextile &Textile)
 Render the paths of each yarn in a textile. More...
 
void RenderPath (CTextile &Textile, int iYarn)
 Render the path of a yarn in a textile. More...
 
void RenderInterference (string TextileName="", bool bDepth=false)
 
void RenderInterference (CTextile &Textile, bool bDepth=false)
 
void RenderGrid (string TextileName="", int iResX=20, int iResY=20, int iResZ=20, double dLengthModifier=1)
 
void RenderGrid (CTextile &Textile, int iResX=20, int iResY=20, int iResZ=20, double dLengthModifier=1)
 
void SetBackgroundColor (COLOR Color)
 Render an image. More...
 
void RenderAxes ()
 Render axes at the bottom left of the window. More...
 
void ClearScene ()
 Remove all objects being rendered. More...
 
void RemoveProps (PROP_TYPE Type)
 Remove all actors of given type. More...
 
void SetPropsColor (PROP_TYPE Type, COLOR Color)
 Remove all actors of given type. More...
 
int GetNumProps (PROP_TYPE Type) const
 Find out how many actors of given type exist. More...
 
vector< vtkProp * > GetProps (PROP_TYPE Type)
 Get the vtkProps of a given type. More...
 
vector< vtkProp * > GetProps (set< PROP_TYPE > Types)
 Get the vtkProps of a set of given types. More...
 
const PROP_YARN_INFOGetYarnPropInfo (vtkProp *pProp) const
 Get information about the surface prop. More...
 
const PROP_NODE_INFOGetNodePropInfo (vtkProp *pProp) const
 Get information about the node prop. More...
 
const PROP_IMAGE_INFOGetImagePropInfo (vtkProp *pProp) const
 Get information about the image prop. More...
 
vector< vtkProp * > GetProps (PROP_INFO *pInfo, bool bIgnoreTextileName=false)
 Get the vtkProps associated with the given object. More...
 
vector< vtkProp * > GetNodeProps (PROP_YARN_INFO Info, bool bIgnoreTextileName=false)
 Get the vtkProps associated with the given object. More...
 
void RefreshYarn (PROP_YARN_INFO YarnInfo)
 Re-render the yarn after it has been updated. More...
 
void RefreshTextile (string TextileName)
 Re-render the textile after it has been updated. More...
 
void ResetCamera (XYZ LookDirection=XYZ())
 Reset the camera so as to see all objects that are rendered. More...
 
void RefreshView ()
 Re-render the scene to take into account updates to it. More...
 
void Start (bool bTakeControl=true, int iWidth=800, int iHeight=600, bool bFullScreen=false)
 Create a new render window and render to it (optionally taking control of the thread) More...
 
void TakeScreenShot (string FileName, int iMagnification=1)
 Saves the current view as a PNG image on the hard disk. More...
 
void SetParallelProjection (bool bParallelProjection)
 Switch between parallel projection and perspective projection. More...
 
vtkRenderer * GetRenderer ()
 Get the renderer object. More...
 
vtkRenderWindowInteractor * GetInteractor ()
 Get the renderer object. More...
 
void SetCallback (void(*pCallback)())
 Set the callback function when an actor is added or deleted. More...
 
void SetXRay (bool bXRay)
 Render yarns as transparent. More...
 
void SetTrimToDomain (bool bTrim)
 Render yarns as transparent. More...
 
void SetYarnColor (int iYarn, COLOR Color)
 Set the colors of the yarns. More...
 
void ApplyDefaultColor (vtkActor *pActor)
 Apply the default material color based on the yarn index. More...
 
bool SaveTextileToVTK (string FileName, string TextileName="", int iExportFlags=EXPORT_NODES|EXPORT_PATH|EXPORT_SURFACE|EXPORT_DOMAIN)
 Save textile data to VTK file format. More...
 
bool SaveMeshToVTK (string FileName, const CMesh &Mesh)
 Save a Mesh to VTK file format. More...
 
void BeginBatch ()
 Increment batch count. More...
 
void EndBatch ()
 Decrement batch count. More...
 
void RemoveNodes ()
 
void RemovePaths ()
 
void RemoveTextiles ()
 
void RemoveMeshes ()
 
void RemoveAxes ()
 
void RemoveInterference ()
 
void RemoveInterferenceDepth ()
 
void RemoveOrientations ()
 
void RemoveDomains ()
 
void RemoveDomainAxes ()
 
vtkPolyData * GetPolyData (const CMesh &Mesh)
 
bool GetXRay () const
 
bool GetTrimToDomain () const
 
bool GetParallelProjection () const
 Determine if parallel projection or perspective projection is switched on. More...
 

Static Public Member Functions

static void ApplyColor (vtkActor *pActor, COLOR Color)
 Apply the material properties. More...
 

Protected Member Functions

void UpdateAxesColor ()
 Updates the axes color based on the background color. More...
 
COLOR GetBestAnnotationColor ()
 Gets the best text color based on the color of the background. More...
 
void AddProp (PROP_TYPE Type, vtkProp *pProp)
 Add an actor to the scene. More...
 
void RemoveProp (vtkProp *pProp)
 
int GetUniqueImageID ()
 Return a unique ID assigned to an image. More...
 
vtkActor * ConvertToActor (vtkAlgorithm *pAlgorithm)
 This function will convert a vtkAlgorithm class into an vtkActor for rendering. More...
 
vtkActor * ConvertToActor (vtkPolyData *pPolyData)
 This function will convert a vtkPolyData class into an vtkActor for rendering. More...
 
vtkAlgorithm * CalculateNormals (vtkPolyData *pInput)
 

Protected Attributes

multimap< PROP_TYPE, vtkProp * > m_Props
 This function will render a direction at a given point. More...
 
map< vtkProp *, PROP_YARN_INFOm_YarnProps
 
map< vtkProp *, PROP_NODE_INFOm_NodeProps
 
map< vtkProp *, PROP_IMAGE_INFOm_ImageProps
 
vtkRenderer * m_pRenderer
 
vtkRenderWindow * m_pRenderWindow
 
vtkRenderWindowInteractor * m_pRenderWindowInteractor
 
vtkOrientationMarkerWidget * m_pOrientationMarkerWidget
 
void(* m_pCallback )()
 
bool m_bXRay
 
bool m_bTrimToDomain
 
int m_iBatchCount
 

Detailed Description

Used for rendering stuff using VTK http://www.vtk.org/.

This class can either be called with a vtkRenderWindowInteractor specified where rendering will be sent to that window. If the instance is constructed with string parameter then a new render window will be created with that name, to start rendering to the new window the Start function should be called.

Definition at line 76 of file TexGenRenderer.h.

Member Enumeration Documentation

◆ EXPORT_FLAG

Enumerator
EXPORT_NODES 
EXPORT_PATH 
EXPORT_SURFACE 
EXPORT_DOMAIN 

Definition at line 97 of file TexGenRenderer.h.

◆ PROP_TYPE

Enumerator
PROP_NODE 
PROP_PATH 
PROP_SURFACE 
PROP_VOLUME 
PROP_AXES 
PROP_INTERFERENCE 
PROP_ORIENTATION 
PROP_DOMAIN 
PROP_DOMAINAXES 
PROP_IMAGE 
PROP_INTERFERENCE_DEPTH 

Definition at line 82 of file TexGenRenderer.h.

Constructor & Destructor Documentation

◆ CTexGenRenderer()

CTexGenRenderer::CTexGenRenderer ( vtkRenderWindowInteractor *  pRenderWindowInteractor = NULL)

◆ ~CTexGenRenderer()

CTexGenRenderer::~CTexGenRenderer ( void  )

Member Function Documentation

◆ AddProp()

void CTexGenRenderer::AddProp ( PROP_TYPE  Type,
vtkProp *  pProp 
)
protected

◆ ApplyColor()

void CTexGenRenderer::ApplyColor ( vtkActor *  pActor,
COLOR  Color 
)
static

◆ ApplyDefaultColor()

void CTexGenRenderer::ApplyDefaultColor ( vtkActor *  pActor)

Apply the default material color based on the yarn index.

Definition at line 1334 of file TexGenRenderer.cpp.

References ApplyColor(), TexGen::GetIndexedColor(), GetNodePropInfo(), GetYarnPropInfo(), TexGen::PROP_YARN_INFO::iYarn, and TexGen::PROP_NODE_INFO::iYarn.

◆ BeginBatch()

void CTexGenRenderer::BeginBatch ( )

Increment batch count.

When the count is greater than zero re-rendering of is suppressed. Each call to BeginBatch must be matched by a later call to EndBatch. Code that does a lot of modification can be enclosed between BeginBatch and EndBatch calls to avoid excessive re-rendering. The final EndBatch will cause the window to be re-rendered.

Definition at line 1434 of file TexGenRenderer.cpp.

References m_iBatchCount.

Referenced by RefreshTextile(), RefreshYarn(), RenderMesh(), RenderNodes(), RenderPaths(), and RenderTextile().

◆ CalculateNormals()

vtkAlgorithm * CTexGenRenderer::CalculateNormals ( vtkPolyData *  pInput)
protected

Definition at line 1309 of file TexGenRenderer.cpp.

Referenced by RenderDomain(), RenderYarn(), and RenderYarnMesh().

◆ ClearScene()

void CTexGenRenderer::ClearScene ( )

Remove all objects being rendered.

Definition at line 178 of file TexGenRenderer.cpp.

References m_Props, RefreshView(), and RemoveProp().

◆ ConvertToActor() [1/2]

vtkActor * CTexGenRenderer::ConvertToActor ( vtkAlgorithm *  pAlgorithm)
protected

This function will convert a vtkAlgorithm class into an vtkActor for rendering.

Definition at line 482 of file TexGenRenderer.cpp.

Referenced by RenderDomain(), RenderYarn(), and RenderYarnMesh().

◆ ConvertToActor() [2/2]

vtkActor * CTexGenRenderer::ConvertToActor ( vtkPolyData *  pPolyData)
protected

This function will convert a vtkPolyData class into an vtkActor for rendering.

Definition at line 469 of file TexGenRenderer.cpp.

◆ EndBatch()

void CTexGenRenderer::EndBatch ( )

Decrement batch count.

When the count is greater than zero re-rendering of is suppressed. Each call to BeginBatch must be matched by a later call to EndBatch. Code that does a lot of modification can be enclosed between BeginBatch and EndBatch calls to avoid excessive re-rendering. The final EndBatch will cause the window to be re-rendered.

Definition at line 1439 of file TexGenRenderer.cpp.

References m_iBatchCount, and RefreshView().

Referenced by RefreshTextile(), RefreshYarn(), RenderMesh(), RenderNodes(), RenderPaths(), and RenderTextile().

◆ GetBestAnnotationColor()

COLOR CTexGenRenderer::GetBestAnnotationColor ( )
protected

Gets the best text color based on the color of the background.

The returned color will either be black or white depending on the darkness of the background.

Definition at line 747 of file TexGenRenderer.cpp.

References m_pRenderer.

Referenced by RenderDomainAxes(), and UpdateAxesColor().

◆ GetImagePropInfo()

const PROP_IMAGE_INFO * CTexGenRenderer::GetImagePropInfo ( vtkProp *  pProp) const

Get information about the image prop.

Definition at line 280 of file TexGenRenderer.cpp.

References m_ImageProps, and NULL.

◆ GetInteractor()

vtkRenderWindowInteractor * TexGen::CTexGenRenderer::GetInteractor ( )
inline

Get the renderer object.

Definition at line 266 of file TexGenRenderer.h.

References m_pRenderWindowInteractor.

◆ GetNodePropInfo()

const PROP_NODE_INFO * CTexGenRenderer::GetNodePropInfo ( vtkProp *  pProp) const

Get information about the node prop.

Definition at line 270 of file TexGenRenderer.cpp.

References m_NodeProps, and NULL.

Referenced by ApplyDefaultColor().

◆ GetNodeProps()

vector< vtkProp * > CTexGenRenderer::GetNodeProps ( PROP_YARN_INFO  Info,
bool  bIgnoreTextileName = false 
)

Get the vtkProps associated with the given object.

Definition at line 329 of file TexGenRenderer.cpp.

References TexGen::PROP_YARN_INFO::iYarn, m_NodeProps, and TexGen::PROP_YARN_INFO::TextileName.

Referenced by RefreshYarn().

◆ GetNumProps()

int CTexGenRenderer::GetNumProps ( PROP_TYPE  Type) const

Find out how many actors of given type exist.

Definition at line 226 of file TexGenRenderer.cpp.

References m_pOrientationMarkerWidget, m_Props, and PROP_AXES.

Referenced by RefreshTextile(), and RefreshYarn().

◆ GetParallelProjection()

bool CTexGenRenderer::GetParallelProjection ( ) const

Determine if parallel projection or perspective projection is switched on.

Definition at line 110 of file TexGenRenderer.cpp.

References m_pRenderer.

◆ GetPolyData()

vtkPolyData * CTexGenRenderer::GetPolyData ( const CMesh Mesh)

◆ GetProps() [1/3]

vector< vtkProp * > CTexGenRenderer::GetProps ( PROP_INFO pInfo,
bool  bIgnoreTextileName = false 
)

◆ GetProps() [2/3]

vector< vtkProp * > CTexGenRenderer::GetProps ( PROP_TYPE  Type)

Get the vtkProps of a given type.

Definition at line 248 of file TexGenRenderer.cpp.

References m_Props.

Referenced by RefreshTextile(), RefreshYarn(), and SetYarnColor().

◆ GetProps() [3/3]

vector< vtkProp * > CTexGenRenderer::GetProps ( set< PROP_TYPE Types)

Get the vtkProps of a set of given types.

Definition at line 234 of file TexGenRenderer.cpp.

References m_Props.

◆ GetRenderer()

vtkRenderer * TexGen::CTexGenRenderer::GetRenderer ( )
inline

Get the renderer object.

Definition at line 263 of file TexGenRenderer.h.

References m_pRenderer.

◆ GetTrimToDomain()

bool TexGen::CTexGenRenderer::GetTrimToDomain ( ) const
inline

Definition at line 331 of file TexGenRenderer.h.

References m_bTrimToDomain.

◆ GetUniqueImageID()

int CTexGenRenderer::GetUniqueImageID ( )
protected

Return a unique ID assigned to an image.

Definition at line 1446 of file TexGenRenderer.cpp.

References m_ImageProps.

◆ GetXRay()

bool TexGen::CTexGenRenderer::GetXRay ( ) const
inline

Definition at line 330 of file TexGenRenderer.h.

References m_bXRay.

◆ GetYarnPropInfo()

const PROP_YARN_INFO * CTexGenRenderer::GetYarnPropInfo ( vtkProp *  pProp) const

Get information about the surface prop.

Definition at line 260 of file TexGenRenderer.cpp.

References m_YarnProps, and NULL.

Referenced by ApplyDefaultColor().

◆ RefreshTextile()

void CTexGenRenderer::RefreshTextile ( string  TextileName)

Re-render the textile after it has been updated.

Definition at line 342 of file TexGenRenderer.cpp.

References BeginBatch(), EndBatch(), GetNumProps(), GetProps(), PROP_NODE, PROP_PATH, PROP_SURFACE, PROP_VOLUME, RemoveProp(), RenderMesh(), RenderNodes(), RenderPaths(), and RenderTextile().

◆ RefreshView()

void CTexGenRenderer::RefreshView ( )

◆ RefreshYarn()

void CTexGenRenderer::RefreshYarn ( PROP_YARN_INFO  YarnInfo)

◆ RemoveAxes()

void TexGen::CTexGenRenderer::RemoveAxes ( )
inline

Definition at line 323 of file TexGenRenderer.h.

References m_pOrientationMarkerWidget, and RefreshView().

◆ RemoveDomainAxes()

void TexGen::CTexGenRenderer::RemoveDomainAxes ( )
inline

Definition at line 328 of file TexGenRenderer.h.

References PROP_DOMAINAXES, and RemoveProps().

◆ RemoveDomains()

void TexGen::CTexGenRenderer::RemoveDomains ( )
inline

Definition at line 327 of file TexGenRenderer.h.

References PROP_DOMAIN, and RemoveProps().

◆ RemoveInterference()

void TexGen::CTexGenRenderer::RemoveInterference ( )
inline

Definition at line 324 of file TexGenRenderer.h.

References PROP_INTERFERENCE, and RemoveProps().

◆ RemoveInterferenceDepth()

void TexGen::CTexGenRenderer::RemoveInterferenceDepth ( )
inline

Definition at line 325 of file TexGenRenderer.h.

References PROP_INTERFERENCE_DEPTH, and RemoveProps().

◆ RemoveMeshes()

void TexGen::CTexGenRenderer::RemoveMeshes ( )
inline

Definition at line 322 of file TexGenRenderer.h.

References PROP_VOLUME, and RemoveProps().

◆ RemoveNodes()

void TexGen::CTexGenRenderer::RemoveNodes ( )
inline

Definition at line 319 of file TexGenRenderer.h.

References PROP_NODE, and RemoveProps().

◆ RemoveOrientations()

void TexGen::CTexGenRenderer::RemoveOrientations ( )
inline

Definition at line 326 of file TexGenRenderer.h.

References PROP_ORIENTATION, and RemoveProps().

◆ RemovePaths()

void TexGen::CTexGenRenderer::RemovePaths ( )
inline

Definition at line 320 of file TexGenRenderer.h.

References PROP_PATH, and RemoveProps().

◆ RemoveProp()

void CTexGenRenderer::RemoveProp ( vtkProp *  pProp)
protected

◆ RemoveProps()

void CTexGenRenderer::RemoveProps ( PROP_TYPE  Type)

◆ RemoveTextiles()

void TexGen::CTexGenRenderer::RemoveTextiles ( )
inline

Definition at line 321 of file TexGenRenderer.h.

References PROP_SURFACE, and RemoveProps().

◆ RenderAxes()

void CTexGenRenderer::RenderAxes ( )

Render axes at the bottom left of the window.

Definition at line 1199 of file TexGenRenderer.cpp.

References m_pOrientationMarkerWidget, and RefreshView().

◆ RenderDomain() [1/2]

void CTexGenRenderer::RenderDomain ( const CDomain Domain,
COLOR  Color = COLOR(1, 1, 1),
double  dOpacity = 0.5 
)

◆ RenderDomain() [2/2]

void CTexGenRenderer::RenderDomain ( string  TextileName = "",
COLOR  Color = COLOR(1, 1, 1),
double  dOpacity = 0.5 
)

◆ RenderDomainAxes() [1/2]

void CTexGenRenderer::RenderDomainAxes ( const CDomain Domain)

◆ RenderDomainAxes() [2/2]

void CTexGenRenderer::RenderDomainAxes ( string  TextileName = "")

◆ RenderGrid() [1/2]

void CTexGenRenderer::RenderGrid ( CTextile Textile,
int  iResX = 20,
int  iResY = 20,
int  iResZ = 20,
double  dLengthModifier = 1 
)

Render a grid of points within given box domain, each point is rendered as a tangent representing the yarn tangent at that point

Definition at line 1037 of file TexGenRenderer.cpp.

References AddProp(), ApplyColor(), TexGen::CMesh::GetAABB(), TexGen::CTextile::GetDomain(), TexGen::GetLength(), TexGen::CDomain::GetMesh(), TexGen::CTextile::GetPointInformation(), TexGen::CTextile::GetYarns(), TexGen::Max(), TexGen::Min(), PROP_ORIENTATION, TexGen::XYZ::x, TexGen::XYZ::y, and TexGen::XYZ::z.

◆ RenderGrid() [2/2]

void CTexGenRenderer::RenderGrid ( string  TextileName = "",
int  iResX = 20,
int  iResY = 20,
int  iResZ = 20,
double  dLengthModifier = 1 
)

Render a grid of points within given box domain, each point is rendered as a tangent representing the yarn tangent at that point

Definition at line 1016 of file TexGenRenderer.cpp.

References TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), and RenderGrid().

Referenced by RenderGrid().

◆ RenderInterference() [1/2]

void CTexGenRenderer::RenderInterference ( CTextile Textile,
bool  bDepth = false 
)

Detect interference and render them If bDepth = true the spheres will be scaled with range from 0 to max intersection depth

Definition at line 943 of file TexGenRenderer.cpp.

References AddProp(), ApplyColor(), TexGen::CTextile::DetectInterference(), TexGen::CTextile::GetApproximateSize(), TexGen::CTextile::GetDomain(), GetPolyData(), m_bTrimToDomain, PROP_INTERFERENCE, PROP_INTERFERENCE_DEPTH, and TGLOG.

◆ RenderInterference() [2/2]

void CTexGenRenderer::RenderInterference ( string  TextileName = "",
bool  bDepth = false 
)

Detect interference and render them If bDepth = true the spheres will be scaled with range from 0 to max intersection depth

Definition at line 924 of file TexGenRenderer.cpp.

References TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), and RenderInterference().

Referenced by RenderInterference().

◆ RenderMesh() [1/2]

void CTexGenRenderer::RenderMesh ( CTextile Textile)

Create the volume mesh and add it to the scene to be rendered.

Parameters
TextileReference to the textile to render
dOpacityOpacity of the textile, set to values less than 1 to allow some transparency

Definition at line 614 of file TexGenRenderer.cpp.

References BeginBatch(), EndBatch(), TexGen::CTextile::GetDomain(), TexGen::GetIndexedColor(), TexGen::CTextile::GetName(), TexGen::CTextile::GetYarns(), TexGen::PROP_YARN_INFO::iYarn, m_bTrimToDomain, m_YarnProps, NULL, RenderYarnMesh(), and TexGen::PROP_YARN_INFO::TextileName.

◆ RenderMesh() [2/2]

void CTexGenRenderer::RenderMesh ( string  TextileName = "")

Create the volume mesh and add it to the scene to be rendered.

Parameters
TextileNameThe name of the textile to be renderered, if left blank will render all textiles

Definition at line 595 of file TexGenRenderer.cpp.

References TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), RenderMesh(), and TGLOGINDENT.

Referenced by RefreshTextile(), and RenderMesh().

◆ RenderNodes() [1/3]

void CTexGenRenderer::RenderNodes ( CTextile Textile)

Render all the master nodes of each yarn in a textile.

Definition at line 803 of file TexGenRenderer.cpp.

References BeginBatch(), EndBatch(), TexGen::CTextile::GetYarns(), and RenderNodes().

◆ RenderNodes() [2/3]

void CTexGenRenderer::RenderNodes ( CTextile Textile,
int  iYarn 
)

◆ RenderNodes() [3/3]

void CTexGenRenderer::RenderNodes ( string  TextileName = "")

Render all the master nodes of each yarn in a textile.

Definition at line 784 of file TexGenRenderer.cpp.

References TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), and RenderNodes().

Referenced by RefreshTextile(), RefreshYarn(), and RenderNodes().

◆ RenderPath()

void CTexGenRenderer::RenderPath ( CTextile Textile,
int  iYarn 
)

◆ RenderPaths() [1/2]

void CTexGenRenderer::RenderPaths ( CTextile Textile)

Render the paths of each yarn in a textile.

Definition at line 875 of file TexGenRenderer.cpp.

References BeginBatch(), EndBatch(), TexGen::CTextile::GetYarns(), and RenderPath().

◆ RenderPaths() [2/2]

void CTexGenRenderer::RenderPaths ( string  TextileName = "")

Render the paths of each yarn in a textile.

Definition at line 856 of file TexGenRenderer.cpp.

References TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), and RenderPaths().

Referenced by RefreshTextile(), and RenderPaths().

◆ RenderTextile() [1/2]

void CTexGenRenderer::RenderTextile ( CTextile Textile,
double  dOpacity = 1 
)

Create the mesh and add it to the scene to be rendered.

Parameters
TextileReference to the textile to render
dOpacityOpacity of the textile, set to values less than 1 to allow some transparency

Definition at line 514 of file TexGenRenderer.cpp.

References BeginBatch(), EndBatch(), TexGen::CTextile::GetDomain(), TexGen::GetIndexedColor(), TexGen::CTextile::GetName(), TexGen::CTextile::GetYarns(), TexGen::PROP_YARN_INFO::iYarn, m_bTrimToDomain, m_YarnProps, NULL, RenderYarn(), and TexGen::PROP_YARN_INFO::TextileName.

◆ RenderTextile() [2/2]

void CTexGenRenderer::RenderTextile ( string  TextileName = "",
double  dOpacity = 1 
)

Create the mesh and add it to the scene to be rendered.

Parameters
TextileNameThe name of the textile to be renderered, if left blank will render all textiles
dOpacityOpacity of the textile, set to values less than 1 to allow some transparency

Definition at line 495 of file TexGenRenderer.cpp.

References TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), RenderTextile(), and TGLOGINDENT.

Referenced by RefreshTextile(), and RenderTextile().

◆ RenderYarn()

vtkProp * CTexGenRenderer::RenderYarn ( CYarn Yarn,
const CDomain pDomain = NULL,
COLOR  Color = COLOR(1, 1, 1),
double  dOpacity = 1 
)

◆ RenderYarnMesh()

vtkProp * CTexGenRenderer::RenderYarnMesh ( CYarn Yarn,
const CDomain pDomain = NULL,
COLOR  Color = COLOR(1, 1, 1) 
)

◆ ResetCamera()

void CTexGenRenderer::ResetCamera ( XYZ  LookDirection = XYZ())

Reset the camera so as to see all objects that are rendered.

Definition at line 1159 of file TexGenRenderer.cpp.

References TexGen::CrossProduct(), m_pRenderer, RefreshView(), TexGen::XYZ::x, TexGen::XYZ::y, and TexGen::XYZ::z.

Referenced by AddProp().

◆ SaveMeshToVTK()

bool CTexGenRenderer::SaveMeshToVTK ( string  FileName,
const CMesh Mesh 
)

Save a Mesh to VTK file format.

Definition at line 1417 of file TexGenRenderer.cpp.

References GetPolyData().

Referenced by SaveTextileToVTK().

◆ SaveTextileToVTK()

bool CTexGenRenderer::SaveTextileToVTK ( string  FileName,
string  TextileName = "",
int  iExportFlags = EXPORT_NODES | EXPORT_PATH | EXPORT_SURFACE | EXPORT_DOMAIN 
)

Save textile data to VTK file format.

Parameters
FileNameThe name of the file to export to, should contain .vtp extension (if it doesn't it will be appended)
TextileNameThe name of the textile to be explorted, if left blank will export all textiles
iExportFlagsA list of flags from CTexGenRenderer::EXPORT_FLAG which determines what will be exported to the file
See also
CTexGenRenderer::EXPORT_FLAG

Definition at line 1375 of file TexGenRenderer.cpp.

References EXPORT_DOMAIN, EXPORT_NODES, EXPORT_PATH, EXPORT_SURFACE, TexGen::CDomain::GetMesh(), TexGen::CMesh::InsertMesh(), m_bTrimToDomain, SaveMeshToVTK(), and TEXGEN.

◆ SetBackgroundColor()

void CTexGenRenderer::SetBackgroundColor ( COLOR  Color)

Render an image.

Set the render window background color where r g and b vary between 0 and 1

Definition at line 94 of file TexGenRenderer.cpp.

References TexGen::COLOR::Array(), m_pRenderer, RefreshView(), and UpdateAxesColor().

◆ SetCallback()

void CTexGenRenderer::SetCallback ( void(*)()  pCallback)

Set the callback function when an actor is added or deleted.

Definition at line 1329 of file TexGenRenderer.cpp.

References m_pCallback.

◆ SetParallelProjection()

void CTexGenRenderer::SetParallelProjection ( bool  bParallelProjection)

Switch between parallel projection and perspective projection.

Definition at line 101 of file TexGenRenderer.cpp.

References m_pRenderer, and RefreshView().

◆ SetPropsColor()

void CTexGenRenderer::SetPropsColor ( PROP_TYPE  Type,
COLOR  Color 
)

Remove all actors of given type.

Definition at line 212 of file TexGenRenderer.cpp.

References ApplyColor(), m_Props, and RefreshView().

◆ SetTrimToDomain()

void CTexGenRenderer::SetTrimToDomain ( bool  bTrim)

Render yarns as transparent.

Definition at line 120 of file TexGenRenderer.cpp.

References m_bTrimToDomain.

◆ SetXRay()

void CTexGenRenderer::SetXRay ( bool  bXRay)

Render yarns as transparent.

Definition at line 115 of file TexGenRenderer.cpp.

References m_bXRay.

◆ SetYarnColor()

void CTexGenRenderer::SetYarnColor ( int  iYarn,
COLOR  Color 
)

Set the colors of the yarns.

Definition at line 1350 of file TexGenRenderer.cpp.

References ApplyColor(), GetProps(), TexGen::PROP_YARN_INFO::iYarn, and RefreshView().

◆ Start()

void CTexGenRenderer::Start ( bool  bTakeControl = true,
int  iWidth = 800,
int  iHeight = 600,
bool  bFullScreen = false 
)

Create a new render window and render to it (optionally taking control of the thread)

Note: this function should only be called if the instance was created without a vtkRenderWindowInteractor specified.

Parameters
bTakeControlIf set to true then a message loop will begin a control will return once the window is closed otherwise the render window will be created and control will return immediatly
iWidthSet the width of the window
iHeightSet the height of the window
bFullScreenDisplay window in fullscreen or not

Definition at line 125 of file TexGenRenderer.cpp.

References m_pRenderWindow, m_pRenderWindowInteractor, and TGLOG.

◆ TakeScreenShot()

void CTexGenRenderer::TakeScreenShot ( string  FileName,
int  iMagnification = 1 
)

Saves the current view as a PNG image on the hard disk.

The file format is PNG hence should have the extension .PNG. Other filetypes are supported by VTK but not implemented here. If additional file types are needed please request the feature.

Parameters
FileNameName of the PNG file to save, should have .png extension
iMagnificationProvides ability to obtain very high resolution images.

Definition at line 139 of file TexGenRenderer.cpp.

References m_pOrientationMarkerWidget, and m_pRenderer.

◆ UpdateAxesColor()

void CTexGenRenderer::UpdateAxesColor ( )
protected

Updates the axes color based on the background color.

If the background color is light then axes are drawn in black. If background is dark then axes are drawn in white.

Definition at line 758 of file TexGenRenderer.cpp.

References TexGen::COLOR::Array(), GetBestAnnotationColor(), m_pOrientationMarkerWidget, m_Props, and PROP_DOMAINAXES.

Referenced by SetBackgroundColor().

Member Data Documentation

◆ m_bTrimToDomain

bool TexGen::CTexGenRenderer::m_bTrimToDomain
protected

◆ m_bXRay

bool TexGen::CTexGenRenderer::m_bXRay
protected

Definition at line 381 of file TexGenRenderer.h.

Referenced by GetXRay(), RenderYarn(), and SetXRay().

◆ m_iBatchCount

int TexGen::CTexGenRenderer::m_iBatchCount
protected

Definition at line 383 of file TexGenRenderer.h.

Referenced by BeginBatch(), EndBatch(), and RefreshView().

◆ m_ImageProps

map<vtkProp*, PROP_IMAGE_INFO> TexGen::CTexGenRenderer::m_ImageProps
protected

Definition at line 372 of file TexGenRenderer.h.

Referenced by GetImagePropInfo(), GetProps(), GetUniqueImageID(), and RemoveProp().

◆ m_NodeProps

map<vtkProp*, PROP_NODE_INFO> TexGen::CTexGenRenderer::m_NodeProps
protected

Definition at line 371 of file TexGenRenderer.h.

Referenced by GetNodePropInfo(), GetNodeProps(), GetProps(), RemoveProp(), and RenderNodes().

◆ m_pCallback

void(* TexGen::CTexGenRenderer::m_pCallback) ()
protected

Definition at line 379 of file TexGenRenderer.h.

Referenced by RefreshView(), and SetCallback().

◆ m_pOrientationMarkerWidget

vtkOrientationMarkerWidget* TexGen::CTexGenRenderer::m_pOrientationMarkerWidget
protected

◆ m_pRenderer

vtkRenderer* TexGen::CTexGenRenderer::m_pRenderer
protected

◆ m_pRenderWindow

vtkRenderWindow* TexGen::CTexGenRenderer::m_pRenderWindow
protected

Definition at line 375 of file TexGenRenderer.h.

Referenced by CTexGenRenderer(), Start(), and ~CTexGenRenderer().

◆ m_pRenderWindowInteractor

vtkRenderWindowInteractor* TexGen::CTexGenRenderer::m_pRenderWindowInteractor
protected

◆ m_Props

multimap<PROP_TYPE, vtkProp*> TexGen::CTexGenRenderer::m_Props
protected

This function will render a direction at a given point.

Definition at line 369 of file TexGenRenderer.h.

Referenced by AddProp(), ClearScene(), GetNumProps(), GetProps(), RemoveProp(), RemoveProps(), SetPropsColor(), and UpdateAxesColor().

◆ m_YarnProps

map<vtkProp*, PROP_YARN_INFO> TexGen::CTexGenRenderer::m_YarnProps
protected

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