22#include "../Core/TexGen.h"
110 void RenderTextile(
string TextileName =
"",
double dOpacity = 1);
178 void RenderGrid(
string TextileName =
"",
int iResX = 20,
int iResY = 20,
int iResZ = 20,
double dLengthModifier = 1);
182 void RenderGrid(
CTextile &Textile,
int iResX = 20,
int iResY = 20,
int iResZ = 20,
double dLengthModifier = 1);
209 vector<vtkProp*>
GetProps(set<PROP_TYPE> Types);
247 void Start(
bool bTakeControl =
true,
int iWidth = 800,
int iHeight = 600,
bool bFullScreen =
false);
Abstract base class representing the domain in which a textile cell may lie.
Defines the nodes and elements of a surface or volume mesh.
Used for rendering stuff using VTK http://www.vtk.org/.
void UpdateAxesColor()
Updates the axes color based on the background color.
void RefreshView()
Re-render the scene to take into account updates to it.
void TakeScreenShot(string FileName, int iMagnification=1)
Saves the current view as a PNG image on the hard disk.
void SetTrimToDomain(bool bTrim)
Render yarns as transparent.
vector< vtkProp * > GetProps(PROP_TYPE Type)
Get the vtkProps of a given type.
map< vtkProp *, PROP_YARN_INFO > m_YarnProps
void RenderDomainAxes(string TextileName="")
Render the dimensions of the domain.
void RemoveInterference()
void RenderPaths(string TextileName="")
Render the paths of each yarn in a textile.
void RenderAxes()
Render axes at the bottom left of the window.
void RenderPath(CTextile &Textile, int iYarn)
Render the path of a yarn in a textile.
void SetYarnColor(int iYarn, COLOR Color)
Set the colors of the yarns.
bool GetTrimToDomain() const
int GetNumProps(PROP_TYPE Type) const
Find out how many actors of given type exist.
vtkProp * RenderYarnMesh(CYarn &Yarn, const CDomain *pDomain=NULL, COLOR Color=COLOR(1, 1, 1))
Render a single yarn mesh with given color.
vtkPolyData * GetPolyData(const CMesh &Mesh)
vtkRenderer * m_pRenderer
vtkProp * RenderYarn(CYarn &Yarn, const CDomain *pDomain=NULL, COLOR Color=COLOR(1, 1, 1), double dOpacity=1)
Render a single yarn with given color.
int GetUniqueImageID()
Return a unique ID assigned to an image.
map< vtkProp *, PROP_IMAGE_INFO > m_ImageProps
const PROP_NODE_INFO * GetNodePropInfo(vtkProp *pProp) const
Get information about the node prop.
void RefreshYarn(PROP_YARN_INFO YarnInfo)
Re-render the yarn after it has been updated.
multimap< PROP_TYPE, vtkProp * > m_Props
This function will render a direction at a given point.
void SetXRay(bool bXRay)
Render yarns as transparent.
void SetPropsColor(PROP_TYPE Type, COLOR Color)
Remove all actors of given type.
void SetCallback(void(*pCallback)())
Set the callback function when an actor is added or deleted.
void AddProp(PROP_TYPE Type, vtkProp *pProp)
Add an actor to the scene.
void RenderGrid(string TextileName="", int iResX=20, int iResY=20, int iResZ=20, double dLengthModifier=1)
vtkAlgorithm * CalculateNormals(vtkPolyData *pInput)
void RefreshTextile(string TextileName)
Re-render the textile after it has been updated.
vector< vtkProp * > GetNodeProps(PROP_YARN_INFO Info, bool bIgnoreTextileName=false)
Get the vtkProps associated with the given object.
void RenderInterference(string TextileName="", bool bDepth=false)
void ClearScene()
Remove all objects being rendered.
bool SaveTextileToVTK(string FileName, string TextileName="", int iExportFlags=EXPORT_NODES|EXPORT_PATH|EXPORT_SURFACE|EXPORT_DOMAIN)
Save textile data to VTK file format.
vtkRenderWindowInteractor * GetInteractor()
Get the renderer object.
void EndBatch()
Decrement batch count.
void RenderNodes(string TextileName="")
Render all the master nodes of each yarn in a textile.
void RenderMesh(string TextileName="")
Create the volume mesh and add it to the scene to be rendered.
bool GetParallelProjection() const
Determine if parallel projection or perspective projection is switched on.
map< vtkProp *, PROP_NODE_INFO > m_NodeProps
vtkRenderer * GetRenderer()
Get the renderer object.
vtkActor * ConvertToActor(vtkAlgorithm *pAlgorithm)
This function will convert a vtkAlgorithm class into an vtkActor for rendering.
void RemoveProps(PROP_TYPE Type)
Remove all actors of given type.
vtkRenderWindowInteractor * m_pRenderWindowInteractor
vtkOrientationMarkerWidget * m_pOrientationMarkerWidget
void SetParallelProjection(bool bParallelProjection)
Switch between parallel projection and perspective projection.
void BeginBatch()
Increment batch count.
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)
void RenderTextile(string TextileName="", double dOpacity=1)
Create the mesh and add it to the scene to be rendered.
void ApplyDefaultColor(vtkActor *pActor)
Apply the default material color based on the yarn index.
void RemoveInterferenceDepth()
const PROP_IMAGE_INFO * GetImagePropInfo(vtkProp *pProp) const
Get information about the image prop.
void RemoveProp(vtkProp *pProp)
@ PROP_INTERFERENCE_DEPTH
void RemoveOrientations()
static void ApplyColor(vtkActor *pActor, COLOR Color)
Apply the material properties.
CTexGenRenderer(vtkRenderWindowInteractor *pRenderWindowInteractor=NULL)
void SetBackgroundColor(COLOR Color)
Render an image.
bool SaveMeshToVTK(string FileName, const CMesh &Mesh)
Save a Mesh to VTK file format.
COLOR GetBestAnnotationColor()
Gets the best text color based on the color of the background.
const PROP_YARN_INFO * GetYarnPropInfo(vtkProp *pProp) const
Get information about the surface prop.
void RenderDomain(string TextileName="", COLOR Color=COLOR(1, 1, 1), double dOpacity=0.5)
Render the domain.
void ResetCamera(XYZ LookDirection=XYZ())
Reset the camera so as to see all objects that are rendered.
vtkRenderWindow * m_pRenderWindow
Represents a textile cell containing yarns.
Represents a yarn consisting of master nodes, section and interpolation function.
Namespace containing a series of customised math operations not found in the standard c++ library.
bool operator<(const PROP_YARN_INFO &left, const PROP_YARN_INFO &right)
Used for sorting algorithms.
Struct for representing points in 3D space.