55 #include <OpenFlipper/BasePlugin/INIInterface.hh> 59 #include <OpenFlipper/BasePlugin/TextureInterface.hh> 64 #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT 67 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 70 #ifdef ENABLE_TETRAHEDRALMESH_SUPPORT 102 std::vector<quint32> indices;
116 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-VTK")
119 void openedFile(
int _id );
120 void addEmptyObject(
DataType _type,
int& _id);
121 void load(QString _filename,
DataType _type,
int& _id);
122 void save(
int _id , QString _filename );
123 void log(
Logtype _type, QString _message);
124 void log(QString _message);
126 void updatedObject(
int _identifier,
const UpdateType& _type);
128 void emptyObjectAdded(
int _id );
129 void deleteObject(
int _id );
132 void showStatusMessage(QString _message,
int _timeout = 0);
136 void pluginExists( QString _pluginName ,
bool& _exists );
137 void functionExists( QString _pluginName , QString _functionName ,
bool& _exists );
140 void setTextureMode(QString _textureName, QString _mode,
int _id );
141 void switchTexture( QString _textureName,
int _id );
142 void addMultiTexture( QString _textureGroup, QString _name, QString _filename,
int _id,
int& _textureId);
143 void textureFilename(
int , QString , QString& );
144 void textureIndex(QString _name,
int _id,
int& _index);
145 void getCurrentTexture(
int , QString& );
146 void textureName (
int,
int, QString &);
147 void getSubTextures (
int, QString, QStringList &);
148 void textureIndexPropertyName(
int, QString&);
152 void fileOpened(
int ){};
163 enum ObjectOptionsVtk
167 FACENORMALS = 1 << 1,
168 VERTEXNORMALS = 1 << 2,
169 VERTEXTEXCOORDS = 1 << 3,
176 QString
name() {
return (QString(
"FileVTK")); };
177 QString
description( ) {
return (QString(tr(
"Load/Save ASCII VTK-Files"))); };
195 bool saveObject(
int _id, QString _filename);
197 QString version() {
return QString(
"1.0"); };
201 bool forceTriangleMesh_;
204 QWidget* saveOptions_;
206 QCheckBox* saveBinary_;
207 QCheckBox* saveFaceNormals_;
208 QCheckBox* saveVertexNormals_;
209 QCheckBox* saveVertexTexCoords_;
210 QLabel* savePrecisionLabel_;
211 QSpinBox* savePrecision_;
212 QPushButton* saveDefaultButton_;
216 unsigned int userWriteOptions_;
232 template <
typename MeshT>
243 template <
typename MeshT>
254 template <
typename MeshT>
265 template <
typename MeshT>
276 template <
typename MeshT>
287 template <
typename MeshT>
300 template <
typename MeshT>
301 int addFaceToOpenMesh(MeshT*& _mesh, quint32 _index1, quint32 _index2, quint32 _index3);
308 template <
typename MeshT>
316 template <
typename MeshT>
324 template <
typename MeshT>
334 template <
typename MeshT>
344 template <
typename MeshT>
352 template <
typename MeshT>
361 template<
class MeshT >
372 int addTetraCell(TriMesh*& _mesh,
const std::vector<quint32>& _indices);
382 int addTetraCell(PolyMesh*& _mesh,
const std::vector<quint32>& _indices);
392 int addHexaCell(TriMesh*& _mesh,
const std::vector<quint32>& _indices);
402 int addHexaCell(PolyMesh*& _mesh,
const std::vector<quint32>& _indices);
412 int addWedgeCell(TriMesh*& _mesh,
const std::vector<quint32>& _indices);
422 int addWedgeCell(PolyMesh*& _mesh,
const std::vector<quint32>& _indices);
432 int addPyramidCell(TriMesh*& _mesh,
const std::vector<quint32>& _indices);
442 int addPyramidCell(PolyMesh*& _mesh,
const std::vector<quint32>& _indices);
452 int addFace(TriMesh*& _mesh,
const std::vector<quint32>& _indices);
462 int addFace(PolyMesh*& _mesh,
const std::vector<quint32>& _indices);
474 int addFace(TriMesh*& _mesh, quint32 _index1, quint32 _index2, quint32 _index3);
486 int addFace(PolyMesh*& _mesh, quint32 _index1, quint32 _index2, quint32 _index3);
596 #if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) 605 template <
typename MeshT>
606 int addTetraCellToOpenVolumeMesh(MeshT _mesh, std::vector<quint32> _indices);
616 template <
typename MeshT>
617 int addHexaCellToOpenVolumeMesh(MeshT _mesh, std::vector<quint32> _indices);
627 template <
typename MeshT>
628 int addWedgeCellToOpenVolumeMesh(MeshT _mesh, std::vector<quint32> _indices);
638 template <
typename MeshT>
639 int addPyramidCellToOpenVolumeMesh(MeshT _mesh, std::vector<quint32> _indices);
649 template <
typename MeshT>
650 int addFaceToOpenVolumeMesh(MeshT*& _mesh, std::vector<quint32> indices);
662 template <
typename MeshT>
663 int addFaceToOpenVolumeMesh(MeshT*& _mesh, quint32 _index1, quint32 _index2, quint32 _index3);
672 template <
typename MeshT>
673 void addVertexNormalToOpenVolumeMesh(MeshT _mesh, quint32 _index,
OpenMesh::Vec3d _normal);
682 template <
typename MeshT>
683 void addFaceNormalToOpenVolumeMesh(MeshT _mesh, quint32 _index,
OpenMesh::Vec3d _normal);
691 template<
class MeshT >
692 bool writeASCIIDataOfOpenVolumeMesh(std::ostream& _out, MeshT& _mesh );
693 #endif //ENABLE_OPENVOLUMEMESH_SUPPORT 695 #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT 816 #endif //ENABLE_HEXAHEDRALMESH_SUPPORT 818 #ifdef ENABLE_POLYHEDRALMESH_SUPPORT 939 #endif //ENABLE_POLYHEDRALMESH_SUPPORT 941 #ifdef ENABLE_TETRAHEDRALMESH_SUPPORT 1062 #endif //ENABLE_POLYHEDRALMESH_SUPPORT 1068 BMT_PolyMesh = 1 << 1,
1069 BMT_HexahedralMesh = 1 << 2,
1070 BMT_PolyhedralMesh = 1 << 3,
1071 BMT_TetrahedralMesh = 1 << 4
1077 template <
typename MeshT>
1078 bool loadMesh(QTextStream& _stream,MeshT*& _mesh, Dataset _type);
1086 template <
typename MeshT>
1087 bool loadMeshPoints(QString _spec,QTextStream& _in,MeshT*& _mesh);
1096 template <
typename MeshT>
1097 bool loadMeshLines(QString _spec,QTextStream& _in,MeshT*& _mesh);
1107 template <
typename MeshT>
1108 bool loadMeshPolygons(QString _spec,QTextStream& _in,MeshT*& _mesh, std::vector<CellType>& _cells);
1118 template <
typename MeshT>
1129 template <
typename MeshT>
1130 bool loadMeshTriangleStrips(QString _spec,QTextStream& _in,MeshT*& _mesh, std::vector<CellType>& _cells);
1140 template <
typename MeshT>
1141 bool loadMeshCells(QString _spec,QTextStream& _in,MeshT*& _mesh, std::vector<CellType>& _cells);
1153 template <
typename MeshT>
1154 bool loadMeshNormals(QString _spec,QTextStream& _in,MeshT*& _mesh, std::vector<CellType>& _cells,
bool _pointNormal, quint32 _count);
1162 template<
class MeshT >
1163 bool writeMesh(std::ostream& _out, MeshT& _mesh );
Interface class for Plugins which have to store information in ini files.
bool loadMeshLines(QString _spec, QTextStream &_in, MeshT *&_mesh)
Reads lines from the stream and adds them to the mesh.
int addFaceToOpenMesh(MeshT *&_mesh, std::vector< quint32 > _indices)
Adds a face to the mesh.
Interface to call functions across plugins.
void addFaceNormal(TriMesh *&_mesh, quint32 _index, OpenMesh::Vec3d _normal)
Adds a face normal.
bool loadMeshNormals(QString _spec, QTextStream &_in, MeshT *&_mesh, std::vector< CellType > &_cells, bool _pointNormal, quint32 _count)
Reads Normals from the stream and adds them to the mesh.
Logtype
Log types for Message Window.
void setNormalsOfDuplicatedVertices(TriMesh *&_mesh)
Sets normals of duplicated vertices that were created for non-manifold meshes.
Interface for all plugins which want to Load or Save files and create Objects.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
Control OpenFlippers status bar.
void removeTemporaryProperties(TriMesh *&_mesh)
Removed temporary properties that might have been added during file reading.
bool loadMeshPoints(QString _spec, QTextStream &_in, MeshT *&_mesh)
Reads points from the stream and adds them to the mesh.
int addTetraCellToOpenMesh(MeshT _mesh, std::vector< quint32 > _indices)
Adds a tetra cell to the mesh. (Does nothing, yet)
Interface for all Plugins which provide scriptable Functions.
bool binary_
Reading binary file?
bool loadMeshPolygons(QString _spec, QTextStream &_in, MeshT *&_mesh, std::vector< CellType > &_cells)
Reads polygons from the stream and adds them to the mesh.
QWidget * saveOptionsWidget(QString)
int addFace(TriMesh *&_mesh, const std::vector< quint32 > &_indices)
Adds a face to the mesh.
void updateVertexNormalsOfOpenMesh(MeshT *&_mesh)
Updates vertex normals.
bool writeMesh(std::ostream &_out, MeshT &_mesh)
Writes the header of the VTK file, then calls writeASCIIData (binary VTK is currently unsupported) ...
Provide texture support for a plugin.
void addVertexNormalToOpenMesh(MeshT _mesh, quint32 _index, OpenMesh::Vec3d _normal)
Adds a vertex normal.
int addHexaCell(TriMesh *&_mesh, const std::vector< quint32 > &_indices)
Adds a hexa cell to the mesh. (Does nothing, yet)
bool writeASCIIDataOfOpenMesh(std::ostream &_out, MeshT &_mesh)
Writes the data of the VTK file in ASCII format.
void updateVertexNormals(TriMesh *&_mesh)
Updates vertex normals.
int addWedgeCell(TriMesh *&_mesh, const std::vector< quint32 > &_indices)
Adds a wedge cell to the mesh. (Does nothing, yet)
Interface for all Plugins which do logging to the logging window of the framework.
BestMeshType findBestObjectType(QString _filename)
Reads the file to check for present primitives and returns the object type that fits best...
void addVertexNormal(TriMesh *&_mesh, quint32 _index, OpenMesh::Vec3d _normal)
Adds a vertex normal.
int loadObject(QString _filename)
Loads Object and converts it to a triangle mesh if possible.
int addPyramidCellToOpenMesh(MeshT _mesh, std::vector< quint32 > _indices)
Adds a pyramid cell to the mesh. (Does nothing, yet)
int addHexaCellToOpenMesh(MeshT _mesh, std::vector< quint32 > _indices)
Adds a hexa cell to the mesh. (Does nothing, yet)
applicationStatus
Enum for the statusBar Status Icon.
void addCellNormal(MeshT *&_mesh, const CellType &_cell, OpenMesh::Vec3d _normal)
Adds a normal to the cell.
int add_non_manifold_face(MeshT *&_mesh, std::vector< OpenMesh::VertexHandle > &_vhandles)
Helper function for loadMeshPolygons() that takes care of adding non-manifold faces.
QWidget * loadOptionsWidget(QString)
void updateFaceNormals(TriMesh *&_mesh)
Updates face normals.
Interface class from which all plugins have to be created.
void removeTemporaryPropertiesOfOpenMesh(MeshT *&_mesh)
Removed temporary properties that might have been added during file reading.
int addPyramidCell(TriMesh *&_mesh, const std::vector< quint32 > &_indices)
Adds a pyramid cell to the mesh. (Does nothing, yet)
void slotSaveDefault()
Slot called when user wants to save the given Save options as default.
Interface class for file handling.
int addWedgeCellToOpenMesh(MeshT _mesh, std::vector< quint32 > _indices)
Adds a wedge cell to the mesh. (Does nothing, yet)
bool loadMeshCells(QString _spec, QTextStream &_in, MeshT *&_mesh, std::vector< CellType > &_cells)
Reads unstructured grid data from the stream and adds it to the mesh.
bool loadMeshTriangleStrips(QString _spec, QTextStream &_in, MeshT *&_mesh, std::vector< CellType > &_cells)
Reads triangle strips from the stream and adds them to the mesh.
void updateFaceNormalsOfOpenMesh(MeshT *&_mesh)
Updates face normals.
QString description()
Return a description of what the plugin is doing.
QString name()
Return a name for the plugin.
int addTetraCell(TriMesh *&_mesh, const std::vector< quint32 > &_indices)
Adds a tetra cell to the mesh. (Does nothing, yet)
FileVTKPlugin()
Constructor.
void initializePlugin()
Initialize Plugin.
void setNormalsOfDuplicatedVerticesOfOpenMesh(MeshT *&_mesh)
Sets normals of duplicated vertices that were created for non-manifold meshes.
bool writeASCIIData(std::ostream &_out, TriMesh &_mesh)
Writes the data of the VTK file in ASCII format.
void addFaceNormalToOpenMesh(MeshT _mesh, quint32 _index, OpenMesh::Vec3d _normal)
Adds a face normal.