Go to the documentation of this file.
56 friend class SetupProcess;
100 int id()
const {
return _id; }
124 const QString &
file()
const {
return _file; }
132 void setFile(
const QString &file = QString());
202 return _attributes.attrMap<int,
int>(
"Cell Parent");
218 return T.setMeshType(mType);
226 if(meshType() ==
"MGX3D")
240 return _attributes.attrMap<int,
Point3f>(
"Cell Center");
252 return _attributes.attrMap<int,
Point3f>(
"Cell Normal");
264 return _attributes.attrMap<int,
Point3f>(
"Cell CenterVis");
276 return _attributes.attrMap<int,
Point3f>(
"Cell NormalVis");
288 return _attributes.attrMap<int,
Point3f>(
"Parent Center");
300 return _attributes.attrMap<int,
Point3f>(
"Parent Normal");
312 return _attributes.attrMap<int,
Point3f>(
"Parent CenterVis");
324 return _attributes.attrMap<int,
Point3f>(
"Parent NormalVis");
334 return _attributes.attrMap<
vertex,
Point2f>(
"Vertex TexCoord2D");
395 bool empty()
const {
return T.S.empty() && T.C.empty(); }
461 return _attributes.attrMap<
IntIntPair,
float>(
"Wall Geom");
484 void updateWallGeometry(
float borderSize);
497 void markBorder(
float borderSize);
503 void updateCentersNormals();
521 changed_surf_function =
true;
542 changed_heat_function =
true;
602 _surfView = SURF_VERTEX;
613 _surfView = SURF_TRIANGLE;
615 _surfTriangleView = s;
624 _surfView = SURF_LABEL;
677 bool showSignal()
const {
return showSurface() and surfView() == SURF_VERTEX and surfVertexView() ==
"Signal"; }
678 bool showLabels()
const {
return showSurface() and surfView() == SURF_LABEL and surfLabelView() ==
"Label"; }
679 bool showHeat()
const {
return showSurface() and surfView() == SURF_LABEL and surfLabelView() ==
"Label Heat"; }
680 bool showWallHeat()
const {
return showSurface() and surfView() == SURF_LABEL and surfLabelView() ==
"Wall Heat"; }
681 bool showTriangleValue()
const {
return showSurface() and surfView() == SURF_TRIANGLE and surfTriangleView() ==
"Triangle Value"; }
698 return _attributes.attrMap<QString,
bool>(
"HasImageTex")[
"HasImageTex"];
704 const QImage &
imgTex()
const {
return _image; }
722 _attributes.attrMap<QString, QByteArray>(
"ImageTex").erase(
"ImageTex");
813 std::vector<vertex> selectedVertices()
const;
818 int selectedCount()
const;
825 std::vector<vertex> activeVertices()
const;
848 bool clearSelection();
859 void correctSelection(
bool inclusive);
872 void updateTriangles();
880 void updatePositions();
884 void updateSelection();
903 return _attributes.attrMap<int,
float>(
"Cell Heat");
913 return _attributes.attrMap<QString, QString>(
"Cell Heat Unit")[
"Cell Heat Unit"];
918 return _attributes.attrMap<QString, QString>(
"Cell Heat Unit")[
"Cell Heat Scaling"];
926 return _attributes.attrMap<QString,
Point2f>(
"Cell Heat Bounds")[
"Cell Heat Bounds"];
939 return _attributes.attrMap<
IntIntPair,
float>(
"Wall Heat");
947 return _attributes.attrMap<QString,
Point2f>(
"Wall Heat Bounds")[
"Wall Heat Bounds"];
955 return _attributes.attrMap<QString, QString>(
"Wall Heat Unit")[
"Wall Heat Unit"];
973 return _attributes.attrMap<
Triangle,
int>(
"Triangle Index");
981 return _attributes.attrMap<
Triangle,
float>(
"Triangle Value");
989 return _attributes.attrMap<QString,
ColorbVec>(
"Triangle Value Color Map")[
"Triangle Value Color Map"];
999 return a[
"Triangle Value Bounds"];
1009 return _attributes.attrMap<QString, QString>(
"Triangle Value Unit")[
"Triangle Value Unit"];
1017 return _attributes.attrMap<QString,
ColorbVec>(
"Triangle Index Color Map")[
"Triangle Index Color Map"];
1042 float width = _attributes.attrMap<QString,
float>(
"Axis Width")[
"Axis Width"];
1055 _attributes.attrMap<QString,
float>(
"Axis Width")[
"Axis Width"] = width;
1064 return _attributes.attrMap<QString,
float>(
"Axis Offset")[
"Axis Offset"];
1072 _attributes.attrMap<QString,
float>(
"Axis Offset")[
"Axis Offset"] =
offset;
1097 return _attributes.attrMap<int,
Matrix3f>(
"Cell Axis Vis");
1105 return _attributes.attrMap<int,
Vec3Colorb>(
"Cell Axis Color");
1111 bool setCellAxisColor(
const Colorb &pos,
const Colorb &neg);
1120 return _attributes.attrMap<QString, QString>(
"Axis Type")[
"Axis Type"];
1130 _attributes.attrMap<QString, QString>(
"Axis Type")[
"Axis Type"] = s;
1139 return _attributes.attrMap<QString, QString>(
"Axis Unit")[
"Axis Unit"];
1147 _attributes.attrMap<QString, QString>(
"Axis Unit")[
"Axis Unit"] = s;
1154 void clearCellAxis();
1190 bool setTriangleAxisColor(
const Colorb &pos,
const Colorb &neg);
1229 bool setVertexAxisColor(
const Colorb &pos,
const Colorb &neg);
1237 return _VVCorrespondence;
1245 return _showVVCorrespondence;
1264 return _attributes.attrMap<QString, QString>(
"Vertex Signal Unit")[
"Vertex Signal Unit"];
1274 return _attributes.attrMap<QString,
Point2f>(
"Vertex Signal Bounds")[
"Vertex Signal Bounds"];
1319 return _attributes.attrMap<QString, QString>(
"Delete Process Name")[meshType];
1341 static bool meshFromTriangles(
vvGraph &S,
const std::vector<vertex> &vertices,
1342 const std::vector<Point3i> &triangles,
bool checkUnique =
true);
1357 bool readVertices(QIODevice &file,
VtxVec &V,
bool transform);
1362 bool readVertexList(QIODevice &file,
vvGraph &S);
1367 bool readNhbds(QIODevice &file,
vvGraph &S);
1372 bool readCellMesh(QIODevice &file,
bool transform);
1377 bool read(QIODevice &file,
bool transform);
1382 bool writeVertices(QIODevice &file,
const vvGraph &S,
bool transform);
1387 bool writeVertexList(QIODevice &file,
const vvGraph &S);
1392 bool writeNhbds(QIODevice &file,
const vvGraph &S);
1397 bool writeCellMesh(QIODevice &file,
bool transform);
1402 bool write(QIODevice &file,
bool transform);
1429 void resetModified();
1436 bool _showVVCorrespondence;
1439 bool changed_surf_function, changed_heat_function;
1441 bool _culling, _blending;
1442 bool _showSurface, _showMesh, _showAxis;
1443 float _opacity, _brightness;
1445 QString _surfVertexView, _surfTriangleView, _surfLabelView;
1446 QString _meshView, _axisView;
1447 bool _showMeshLines, _showMeshPoints, _showMeshCellMap;
1455 const Stack* _stack;
1461 QString _deleteProcess;
QString & deleteProcessName(QString &meshType)
Process use to to delete cells or vertices from different mesh types.
ColorbVec & triangleIndexColors()
Return the colormap for the triangle values.
IntPoint3fAttr & labelCenter()
Reference to the map from label to a center position.
IntPoint3fAttr & labelNormal()
Reference to the map from label to a normal.
void setShowMeshPoints(bool show)
Set if the mesh points are visible.
void setBlending(bool b)
Set the blending attribute.
int id() const
Id of the current mesh.
QString surfLabelView() const
Returns the label visualization.
vvGraph::vertex_t vertex
Type of a vertex.
bool transformed() const
Returns true if the mesh is transformed.
Holds a set of attributes.
QString & heatMapScaling()
TriSymTensorAttr & triangleAxis()
Tensor quantity for each triangle.
std::vector< vertex > VtxVec
Vector of vertices.
@ SURF_LABEL
Label level rendering.
int viewLabel() const
Returns the current label, without modifying it.
const Attributes & attributes() const
Get the mesh attributes.
QString axisView() const
Return the current view mode for the axis.
const vvGraph & junctions() const
Get the VV junction graph.
bool showTriangleValue() const
bool showMesh() const
Is the mesh currently visible to the user.
IntVec3ColorbAttr & cellAxisColor()
Returns the map from label to cells axis colors (array of 3 Point3f)
void setShowBBox(bool on=true)
Set if the bounding box is shown.
@ SURF_TRIANGLE
Triangle level rendering.
void setShowLabel(const QString &s="", bool setView=true)
Set the surface label display.
TransferFunction heatFct() const
Return the transfer function used to draw the surface in heat mode.
const vvGraph & graph() const
Get the VV graph of the mesh.
QString meshView() const
Return the current view mode for the mesh.
IntPoint3fAttr & parentCenterVis()
Reference to the map from parent label to a position.
void setLabel(int l)
Sets the current label.
void setTransformed(bool on=true)
Set if the mesh is transformed.
IntVtxMap & vMap()
Map vertex saveId to vertex.
std::map< int, IntSet > IntIntSetMap
Map of an integer to a set of integers.
bool showSurface() const
True if the surface is currently visible to the user.
Point2f & triangleValueBounds()
Return the upper and lower bounds for the triangle value.
VtxPoint2fAttr & texCoord2d()
Reference to a map of 2D texture coordinates, this is used to load 3D images like that from the Keyan...
bool showWallHeat() const
void setSurfFct(const TransferFunction &f)
Change the transfer function used to draw the surface in normal mode.
void setAxisView(const QString &s, bool setShow=true)
Set the axis display and view.
int & ccTab()
Cell complex tab.
void setCulling(bool cul)
Cull the back surface.
const Stack * stack() const
Returns the stack associated to this mesh.
void setShowSurface(bool val=true)
Show the surface to the user.
std::unordered_map< int, vertex > IntVtxMap
Int to vertex map.
bool & hasImgTex()
True if the surface has a texture attached to it.
void setShowMeshLines(bool show)
Set if the mesh lines are visible.
int nextLabel()
Increment the current label and return.
IntIntSetMap & labelNeighbors()
Reference to the map from labels to the set of neighbor labels.
float opacity() const
Get the current opacity level of the surface.
TriFloatAttr & triangleValue()
Triangle value for interpolated color map mode.
int userId() const
Id as seen by the user.
cellGraph & cells()
Get the cell graph.
QString & wallHeatUnit()
Wall heat unit.
CellTissue & tissue()
Get the Cell Tissue.
float setAxisWidth(float width)
VtxSymTensorAttr & vertexAxis()
bool empty() const
True if the mesh is empty (i.e.
IntSymTensorAttr & cellAxis()
Cell axis tensor quantity for each cell.
IntIntFloatAttr & wallGeom()
Reference to the map from each wall to the length of the wall.
bool culling() const
Returns if the back surface is culled.
TriMatrix3fAttr & triangleAxisVis()
Cell axis for visualization.
@ SURF_VERTEX
Vertex level rendering such as projected signal.
CellTissue::DistNhbdC & nhbdC()
Get the neighborhood object for the cell graph.
IntIntFloatAttr & wallHeat()
Reference to map of heat data by wall (i.e.
void setShowMesh(bool show=true)
Set the mesh visibility.
Distributed matrix library.
void setBrightness(float f)
Change the current brightness of the surface.
QString & signalUnit()
Reference to the unit used for the signal.
const IntIntSetMap & labelNeighbors() const
Returns the map from labels to the set of neighbors labels.
Point2f & signalBounds()
Reference to the upper and lower bounds for the signal.
IntCellMap & cMap()
Map cell saveId to cell.
QString & heatMapUnit()
Reference to the unit used for the current heat map.
QString surfTriangleView() const
Returns the triangle visualization.
bool surfFctChanged() const
Returns true if the normal transfer function has been changed during the current process.
bool scaled() const
Returns true if the mesh is scaled.
bool mesh3D()
Convenience function to tell if a 3D mesh (from viewpoint of rendering)
std::pair< int, int > IntIntPair
Element in IntIntMap.
mgx_EXPORT int getLabel(const vertex &v1, const vertex &v2, const vertex &v3)
Return the label for a triangle.
IntPoint3fAttr & parentCenter()
Reference to the map from parent label to a position.
vvGraph & junctions()
Get the VV junction graph.
TransferFunction surfFct() const
Return the transfer function used to draw the surface in normal mode.
bool showSignal() const
Convenience functions.
void setHeatFct(const TransferFunction &f)
Change the transfer function used to draw the surface in heat mode.
void setShowTriangle(const QString &s="", bool setView=true)
Set the surface triangle display.
bool heatFctChanged() const
Returns true if the heat transfer function has been changed during the current process.
void setUseParents(bool val)
Show the color of the surface.
const CellTissue & tissue() const
Get the Cell Tissue.
IntMatrix3fAttr & cellAxisVis()
Cell axis for visualization.
ColorbVec & triangleValueColors()
Return the colormap for the triangle values.
std::unordered_map< int, HVec3U > IntHVec3uMap
Map of an integer to a host vector of 3 unsigned integers.
IntPoint3fAttr & labelNormalVis()
Reference to the map from label to a normal.
std::vector< Colorb > ColorbVec
std::pair< int, HVec3U > IntHVec3uPair
Element in IntHVec3uMap.
QString setCellAxisType(const QString &s)
Set the type of the current cell axis.
std::unordered_map< int, Matrix3f > IntMatrix3fMap
Map of an integer to a 3x3 matrix.
QString setCellAxisUnit(const QString &s)
Unit for the length of the cell axis.
IntIntAttr & parents()
Reference to the map from each label to its parent.
VtxVec3ColorbAttr & vertexAxisColor()
Returns the map from label to cells axis colors (array of 3 Point3f)
const QString & meshType()
Returns the mesh type.
void setShowMeshCellMap(bool show)
Set if the cell numbers are visible.
class Triangle Triangle.hpp <Triangle.hpp>
const IntIntVIdSetMap & wallVId() const
Returns the map from each wall to the list of vertexes in the wall.
bool showAxis() const
Is the axis currently visible to the user.
Point2f & wallHeatBounds()
Upper and lower bounds for the heat.
IntIntVIdSetMap & wallVId()
Reference to the map from each wall to the list of vertexes in the wall.
const ValueT & defaultVal() const
Get a reference to the default value.
QString cellAxisUnit()
Unit for the length of the cell axis.
void setBoundingBox(const BoundingBox3f &bbox)
Set the mesh bounding box.
float brightness() const
Get the current brightness of the surface.
VtxMatrix3fAttr & vertexAxisVis()
Cell axis for visualization.
void clearImgTex()
Remove any texture attached to the surface.
cellGraph::vertex_t cell
Type of a vertex.
IntFloatAttr & labelHeat()
Reference to map of heat data by label.
const QString & file() const
Returns the name of the mesh file.
TriVec3ColorbAttr & triangleColor()
Triangle colors.
void setScaled(bool on=true)
Set if the mesh is scaled.
std::pair< vertex, SymmetricTensor > VtxSymTensorPair
Tensor quantity for each vertex.
void setShowAxis(bool show=true)
Set the axis display.
Vector< 2, float > Point2f
void setOpacity(float f)
Change the current opactity level of the surface.
vvGraph & graph()
Get the VV graph of the mesh.
QString & ccName()
Current cell complex.
bool blending() const
Return if the surface is rendered blended or not.
SurfView surfView() const
Returns the current visualization for the surface.
IntPoint3fAttr & labelCenterVis()
Reference to the map from label to a position.
bool showMeshCellMap() const
Are cell numbers visible.
float setAxisOffset(float offset)
bool showMeshPoints() const
Are mesh points visible.
QString & triangleValueUnit()
Reference to the unit used for triangle values.
SurfView
Surface visualization type.
IntMatrix3fMap & vvCorrespondence()
Returns a reference to the map of correspondence between vertices in mesh1 and mesh2 (store vertices ...
TriIntAttr & triangleIndex()
Triangle index for indexed color map mode.
CellTissue::DistNhbdS & nhbdS()
Get the neighborhood object for the S graph.
std::unordered_map< int, cell > IntCellMap
Int to cell map.
A utility class to encapsulate color data.
BoundingBox3f & boundingBox()
const cellGraph & cells() const
Get the cell graph.
std::unordered_map< vertex, int > VtxIntMap
Map of vertex to int.
Point2f & heatMapBounds()
Return the upper and lower bounds for the heat.
bool & showVVCorrespondence()
const QImage & imgTex() const
Get the current texture attached to the surface.
QString surfVertexView() const
Returns the vertex visualization.
Attributes & attributes()
void setId(int i)
Change the id of the mesh.
int changes() const
Returns what changed in the current process.
std::set< vertex > VtxSet
Set of vertices.
bool showMeshLines() const
Are mesh lines visible.
void setShowVertex(const QString &s="", bool setView=true)
Set the surface vertex display.
const BoundingBox3f & boundingBox() const
Reference to the mesh bounding box.
std::map< IntIntPair, VIdSet > IntIntVIdSetMap
Map of a pair of integers to a set of vertex ids.
bool chkGraph(vvGraph &S)
Check the graph for consistency.
TriVec3ColorbAttr & triangleAxisColor()
Returns the map from label to cells axis colors (array of 3 Point3f)
CU_HOST_DEVICE size_t offset(uint x, uint y, uint z, uint xsz, uint ysz)
IntPoint3fAttr & parentNormalVis()
Reference to the map from parent label to a normal.
bool useParents()
Returns if we should use parents or labels.
std::vector< vvGraph > VVGraphVec
Vector of vvGraphs.
const QString & setMeshType(const QString &mType)
Set the mesh type.
CellVec2ColorbAttr & cellColor()
Cell colors.
void setSurfView(SurfView view)
Change the view mode.
QString cellAxisType()
Return the type of the current cell axis.
void setImgTex(const QImage &img)
Set the texture attached to the surface.
void setMeshView(const QString &s, bool setShow=true)
Set the mesh display and view.
Attribute map wraps std::map.
IntPoint3fAttr & parentNormal()
Reference to the map from parent label to a normal.
bool showBBox() const
Returns true if the bounding box is shown.