TexGen
|
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_INFO * | GetYarnPropInfo (vtkProp *pProp) const |
Get information about the surface prop. More... | |
const PROP_NODE_INFO * | GetNodePropInfo (vtkProp *pProp) const |
Get information about the node prop. More... | |
const PROP_IMAGE_INFO * | GetImagePropInfo (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_INFO > | m_YarnProps |
map< vtkProp *, PROP_NODE_INFO > | m_NodeProps |
map< vtkProp *, PROP_IMAGE_INFO > | m_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 |
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.
Enumerator | |
---|---|
EXPORT_NODES | |
EXPORT_PATH | |
EXPORT_SURFACE | |
EXPORT_DOMAIN |
Definition at line 97 of file TexGenRenderer.h.
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.
CTexGenRenderer::CTexGenRenderer | ( | vtkRenderWindowInteractor * | pRenderWindowInteractor = NULL | ) |
Definition at line 26 of file TexGenRenderer.cpp.
References m_pOrientationMarkerWidget, m_pRenderer, m_pRenderWindow, m_pRenderWindowInteractor, and CCustomInteractorStyle::New().
CTexGenRenderer::~CTexGenRenderer | ( | void | ) |
Definition at line 71 of file TexGenRenderer.cpp.
References m_pOrientationMarkerWidget, m_pRenderer, m_pRenderWindow, m_pRenderWindowInteractor, and NULL.
|
protected |
Add an actor to the scene.
Definition at line 423 of file TexGenRenderer.cpp.
References m_pRenderer, m_Props, RefreshView(), and ResetCamera().
Referenced by RenderDomain(), RenderDomainAxes(), RenderGrid(), RenderInterference(), RenderNodes(), RenderPath(), RenderYarn(), and RenderYarnMesh().
|
static |
Apply the material properties.
Definition at line 1365 of file TexGenRenderer.cpp.
References TexGen::COLOR::Array().
Referenced by ApplyDefaultColor(), RenderGrid(), RenderInterference(), RenderNodes(), RenderPath(), RenderYarn(), RenderYarnMesh(), SetPropsColor(), and SetYarnColor().
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.
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().
|
protected |
Definition at line 1309 of file TexGenRenderer.cpp.
Referenced by RenderDomain(), RenderYarn(), and RenderYarnMesh().
void CTexGenRenderer::ClearScene | ( | ) |
Remove all objects being rendered.
Definition at line 178 of file TexGenRenderer.cpp.
References m_Props, RefreshView(), and RemoveProp().
|
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().
|
protected |
This function will convert a vtkPolyData class into an vtkActor for rendering.
Definition at line 469 of file TexGenRenderer.cpp.
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().
|
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().
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.
|
inline |
Get the renderer object.
Definition at line 266 of file TexGenRenderer.h.
References m_pRenderWindowInteractor.
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().
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().
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().
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.
vtkPolyData * CTexGenRenderer::GetPolyData | ( | const CMesh & | Mesh | ) |
Definition at line 1226 of file TexGenRenderer.cpp.
References TexGen::CMesh::GetIndices(), TexGen::CMesh::GetNumNodes(), TexGen::CMesh::HEX, TexGen::CMesh::NodesBegin(), TexGen::CMesh::NodesEnd(), TexGen::CMesh::NUM_ELEMENT_TYPES, TexGen::CMesh::POLYGON, TexGen::CMesh::POLYLINE, and TexGen::CMesh::WEDGE.
Referenced by RenderDomain(), RenderInterference(), RenderPath(), RenderYarn(), RenderYarnMesh(), and SaveMeshToVTK().
vector< vtkProp * > CTexGenRenderer::GetProps | ( | PROP_INFO * | pInfo, |
bool | bIgnoreTextileName = false |
||
) |
Get the vtkProps associated with the given object.
Definition at line 290 of file TexGenRenderer.cpp.
References TexGen::PROP_IMAGE_INFO::iImageID, TexGen::PROP_NODE_INFO::iNode, TexGen::PROP_YARN_INFO::iYarn, TexGen::PROP_NODE_INFO::iYarn, m_ImageProps, m_NodeProps, m_YarnProps, TexGen::PROP_YARN_INFO::TextileName, and TexGen::PROP_NODE_INFO::TextileName.
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().
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.
|
inline |
|
inline |
Definition at line 331 of file TexGenRenderer.h.
References m_bTrimToDomain.
|
protected |
Return a unique ID assigned to an image.
Definition at line 1446 of file TexGenRenderer.cpp.
References m_ImageProps.
|
inline |
Definition at line 330 of file TexGenRenderer.h.
References m_bXRay.
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().
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().
void CTexGenRenderer::RefreshView | ( | ) |
Re-render the scene to take into account updates to it.
Definition at line 1185 of file TexGenRenderer.cpp.
References m_iBatchCount, m_pCallback, m_pRenderer, and m_pRenderWindowInteractor.
Referenced by AddProp(), ClearScene(), EndBatch(), RemoveAxes(), RemoveProps(), RenderAxes(), ResetCamera(), SetBackgroundColor(), SetParallelProjection(), SetPropsColor(), and SetYarnColor().
void CTexGenRenderer::RefreshYarn | ( | PROP_YARN_INFO | YarnInfo | ) |
Re-render the yarn after it has been updated.
Definition at line 371 of file TexGenRenderer.cpp.
References BeginBatch(), EndBatch(), TexGen::CTextile::GetDomain(), TexGen::GetIndexedColor(), GetNodeProps(), GetNumProps(), GetProps(), TexGen::CTextile::GetYarns(), TexGen::PROP_YARN_INFO::iYarn, m_bTrimToDomain, m_YarnProps, NULL, PROP_NODE, PROP_PATH, PROP_SURFACE, PROP_VOLUME, RemoveProp(), RenderNodes(), RenderPath(), RenderYarn(), RenderYarnMesh(), TEXGEN, and TexGen::PROP_YARN_INFO::TextileName.
|
inline |
Definition at line 323 of file TexGenRenderer.h.
References m_pOrientationMarkerWidget, and RefreshView().
|
inline |
Definition at line 328 of file TexGenRenderer.h.
References PROP_DOMAINAXES, and RemoveProps().
|
inline |
Definition at line 327 of file TexGenRenderer.h.
References PROP_DOMAIN, and RemoveProps().
|
inline |
Definition at line 324 of file TexGenRenderer.h.
References PROP_INTERFERENCE, and RemoveProps().
|
inline |
Definition at line 325 of file TexGenRenderer.h.
References PROP_INTERFERENCE_DEPTH, and RemoveProps().
|
inline |
Definition at line 322 of file TexGenRenderer.h.
References PROP_VOLUME, and RemoveProps().
|
inline |
Definition at line 319 of file TexGenRenderer.h.
References PROP_NODE, and RemoveProps().
|
inline |
Definition at line 326 of file TexGenRenderer.h.
References PROP_ORIENTATION, and RemoveProps().
|
inline |
Definition at line 320 of file TexGenRenderer.h.
References PROP_PATH, and RemoveProps().
|
protected |
Definition at line 453 of file TexGenRenderer.cpp.
References m_ImageProps, m_NodeProps, m_pRenderer, m_Props, and m_YarnProps.
Referenced by ClearScene(), RefreshTextile(), RefreshYarn(), and RemoveProps().
void CTexGenRenderer::RemoveProps | ( | PROP_TYPE | Type | ) |
Remove all actors of given type.
Definition at line 198 of file TexGenRenderer.cpp.
References m_Props, RefreshView(), and RemoveProp().
Referenced by RemoveDomainAxes(), RemoveDomains(), RemoveInterference(), RemoveInterferenceDepth(), RemoveMeshes(), RemoveNodes(), RemoveOrientations(), RemovePaths(), and RemoveTextiles().
|
inline |
Definition at line 321 of file TexGenRenderer.h.
References PROP_SURFACE, and RemoveProps().
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().
void CTexGenRenderer::RenderDomain | ( | const CDomain & | Domain, |
COLOR | Color = COLOR(1, 1, 1) , |
||
double | dOpacity = 0.5 |
||
) |
Render the domain.
Definition at line 665 of file TexGenRenderer.cpp.
References AddProp(), TexGen::COLOR::Array(), CalculateNormals(), ConvertToActor(), TexGen::CDomain::Copy(), TexGen::CMesh::GetAABB(), TexGen::GetLength(), TexGen::CDomain::GetMesh(), GetPolyData(), TexGen::CDomain::Grow(), TexGen::CMesh::NodesEmpty(), PROP_DOMAIN, and TGLOGINDENT.
void CTexGenRenderer::RenderDomain | ( | string | TextileName = "" , |
COLOR | Color = COLOR(1, 1, 1) , |
||
double | dOpacity = 0.5 |
||
) |
Render the domain.
Definition at line 571 of file TexGenRenderer.cpp.
References TexGen::CTextile::GetDomain(), TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), RenderDomain(), and TGLOGINDENT.
Referenced by RenderDomain().
void CTexGenRenderer::RenderDomainAxes | ( | const CDomain & | Domain | ) |
Render the dimensions of the domain.
Definition at line 718 of file TexGenRenderer.cpp.
References AddProp(), TexGen::COLOR::Array(), TexGen::CMesh::GetAABB(), GetBestAnnotationColor(), TexGen::CDomain::GetMesh(), m_pRenderer, and PROP_DOMAINAXES.
void CTexGenRenderer::RenderDomainAxes | ( | string | TextileName = "" | ) |
Render the dimensions of the domain.
Definition at line 694 of file TexGenRenderer.cpp.
References TexGen::CTextile::GetDomain(), TexGen::CSingleton< CTexGen >::GetInstance(), TexGen::CTexGen::GetTextile(), TexGen::CTexGen::GetTextiles(), RenderDomainAxes(), and TGLOGINDENT.
Referenced by RenderDomainAxes().
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.
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().
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.
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().
void CTexGenRenderer::RenderMesh | ( | CTextile & | Textile | ) |
Create the volume mesh and add it to the scene to be rendered.
Textile | Reference to the textile to render |
dOpacity | Opacity 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.
void CTexGenRenderer::RenderMesh | ( | string | TextileName = "" | ) |
Create the volume mesh and add it to the scene to be rendered.
TextileName | The 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().
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().
void CTexGenRenderer::RenderNodes | ( | CTextile & | Textile, |
int | iYarn | ||
) |
Render all the master nodes of each yarn in a textile.
Definition at line 815 of file TexGenRenderer.cpp.
References AddProp(), ApplyColor(), BeginBatch(), EndBatch(), TexGen::CTextile::GetApproximateSize(), TexGen::GetIndexedColor(), TexGen::CYarn::GetMasterNodes(), TexGen::CTextile::GetName(), TexGen::CTextile::GetYarns(), TexGen::PROP_NODE_INFO::iNode, TexGen::PROP_NODE_INFO::iYarn, m_NodeProps, PROP_NODE, TexGen::PROP_NODE_INFO::TextileName, TexGen::XYZ::x, TexGen::XYZ::y, and TexGen::XYZ::z.
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().
void CTexGenRenderer::RenderPath | ( | CTextile & | Textile, |
int | iYarn | ||
) |
Render the path of a yarn in a textile.
Definition at line 886 of file TexGenRenderer.cpp.
References TexGen::CYarn::AddPathToMesh(), AddProp(), ApplyColor(), TexGen::CTextile::GetApproximateSize(), TexGen::GetIndexedColor(), TexGen::CTextile::GetName(), GetPolyData(), TexGen::CTextile::GetYarns(), TexGen::PROP_YARN_INFO::iYarn, m_YarnProps, PROP_PATH, and TexGen::PROP_YARN_INFO::TextileName.
Referenced by RefreshYarn(), and RenderPaths().
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().
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().
void CTexGenRenderer::RenderTextile | ( | CTextile & | Textile, |
double | dOpacity = 1 |
||
) |
Create the mesh and add it to the scene to be rendered.
Textile | Reference to the textile to render |
dOpacity | Opacity 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.
void CTexGenRenderer::RenderTextile | ( | string | TextileName = "" , |
double | dOpacity = 1 |
||
) |
Create the mesh and add it to the scene to be rendered.
TextileName | The name of the textile to be renderered, if left blank will render all textiles |
dOpacity | Opacity 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().
vtkProp * CTexGenRenderer::RenderYarn | ( | CYarn & | Yarn, |
const CDomain * | pDomain = NULL , |
||
COLOR | Color = COLOR(1, 1, 1) , |
||
double | dOpacity = 1 |
||
) |
Render a single yarn with given color.
Definition at line 539 of file TexGenRenderer.cpp.
References AddProp(), TexGen::CYarn::AddSurfaceToMesh(), ApplyColor(), CalculateNormals(), ConvertToActor(), GetPolyData(), m_bXRay, TexGen::CMesh::NodesEmpty(), NULL, PROP_SURFACE, and TGLOGINDENT.
Referenced by RefreshYarn(), and RenderTextile().
vtkProp * CTexGenRenderer::RenderYarnMesh | ( | CYarn & | Yarn, |
const CDomain * | pDomain = NULL , |
||
COLOR | Color = COLOR(1, 1, 1) |
||
) |
Render a single yarn mesh with given color.
Definition at line 639 of file TexGenRenderer.cpp.
References AddProp(), TexGen::CYarn::AddVolumeToMesh(), ApplyColor(), CalculateNormals(), ConvertToActor(), GetPolyData(), TexGen::CMesh::NodesEmpty(), NULL, PROP_VOLUME, and TGLOGINDENT.
Referenced by RefreshYarn(), and RenderMesh().
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().
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().
bool CTexGenRenderer::SaveTextileToVTK | ( | string | FileName, |
string | TextileName = "" , |
||
int | iExportFlags = EXPORT_NODES | EXPORT_PATH | EXPORT_SURFACE | EXPORT_DOMAIN |
||
) |
Save textile data to VTK file format.
FileName | The name of the file to export to, should contain .vtp extension (if it doesn't it will be appended) |
TextileName | The name of the textile to be explorted, if left blank will export all textiles |
iExportFlags | A list of flags from CTexGenRenderer::EXPORT_FLAG which determines what will be exported to the file |
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.
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().
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.
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().
Remove all actors of given type.
Definition at line 212 of file TexGenRenderer.cpp.
References ApplyColor(), m_Props, and RefreshView().
void CTexGenRenderer::SetTrimToDomain | ( | bool | bTrim | ) |
Render yarns as transparent.
Definition at line 120 of file TexGenRenderer.cpp.
References m_bTrimToDomain.
void CTexGenRenderer::SetXRay | ( | bool | bXRay | ) |
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().
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.
bTakeControl | If 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 |
iWidth | Set the width of the window |
iHeight | Set the height of the window |
bFullScreen | Display window in fullscreen or not |
Definition at line 125 of file TexGenRenderer.cpp.
References m_pRenderWindow, m_pRenderWindowInteractor, and TGLOG.
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.
FileName | Name of the PNG file to save, should have .png extension |
iMagnification | Provides ability to obtain very high resolution images. |
Definition at line 139 of file TexGenRenderer.cpp.
References m_pOrientationMarkerWidget, and m_pRenderer.
|
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().
|
protected |
Definition at line 382 of file TexGenRenderer.h.
Referenced by GetTrimToDomain(), RefreshYarn(), RenderInterference(), RenderMesh(), RenderTextile(), SaveTextileToVTK(), and SetTrimToDomain().
|
protected |
Definition at line 381 of file TexGenRenderer.h.
Referenced by GetXRay(), RenderYarn(), and SetXRay().
|
protected |
Definition at line 383 of file TexGenRenderer.h.
Referenced by BeginBatch(), EndBatch(), and RefreshView().
|
protected |
Definition at line 372 of file TexGenRenderer.h.
Referenced by GetImagePropInfo(), GetProps(), GetUniqueImageID(), and RemoveProp().
|
protected |
Definition at line 371 of file TexGenRenderer.h.
Referenced by GetNodePropInfo(), GetNodeProps(), GetProps(), RemoveProp(), and RenderNodes().
|
protected |
Definition at line 379 of file TexGenRenderer.h.
Referenced by RefreshView(), and SetCallback().
|
protected |
Definition at line 377 of file TexGenRenderer.h.
Referenced by CTexGenRenderer(), GetNumProps(), RemoveAxes(), RenderAxes(), TakeScreenShot(), UpdateAxesColor(), and ~CTexGenRenderer().
|
protected |
Definition at line 374 of file TexGenRenderer.h.
Referenced by AddProp(), CTexGenRenderer(), GetBestAnnotationColor(), GetParallelProjection(), GetRenderer(), RefreshView(), RemoveProp(), RenderDomainAxes(), ResetCamera(), SetBackgroundColor(), SetParallelProjection(), TakeScreenShot(), and ~CTexGenRenderer().
|
protected |
Definition at line 375 of file TexGenRenderer.h.
Referenced by CTexGenRenderer(), Start(), and ~CTexGenRenderer().
|
protected |
Definition at line 376 of file TexGenRenderer.h.
Referenced by CTexGenRenderer(), GetInteractor(), RefreshView(), Start(), and ~CTexGenRenderer().
|
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().
|
protected |
Definition at line 370 of file TexGenRenderer.h.
Referenced by GetProps(), GetYarnPropInfo(), RefreshYarn(), RemoveProp(), RenderMesh(), RenderPath(), and RenderTextile().