ccMeshGroup.h 5.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //##########################################################################
  2. //# #
  3. //# CLOUDCOMPARE #
  4. //# #
  5. //# This program is free software; you can redistribute it and/or modify #
  6. //# it under the terms of the GNU General Public License as published by #
  7. //# the Free Software Foundation; version 2 or later of the License. #
  8. //# #
  9. //# This program is distributed in the hope that it will be useful, #
  10. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  11. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  12. //# GNU General Public License for more details. #
  13. //# #
  14. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  15. //# #
  16. //##########################################################################
  17. #ifndef CC_MESH_GROUP_HEADER
  18. #define CC_MESH_GROUP_HEADER
  19. //Local
  20. #include "ccGenericMesh.h"
  21. //! [DEPRECATED] A group of meshes sharing vertices (and associated properties) in a unique cloud
  22. /** This is an empty shell for backward compatibility.
  23. Shouldn't be used anymore.
  24. **/
  25. class QCC_DB_LIB_API ccMeshGroup : public ccGenericMesh
  26. {
  27. public:
  28. //! Default constructor
  29. ccMeshGroup() : ccGenericMesh("[Deprecated] Mesh Group") {}
  30. //! Returns class ID
  31. CC_CLASS_ENUM getClassID() const override { return CC_TYPES::MESH_GROUP; }
  32. //inherited methods (ccGenericMesh)
  33. ccGenericPointCloud* getAssociatedCloud() const override { return 0; }
  34. void refreshBB() override {}
  35. bool interpolateNormals(unsigned triIndex, const CCVector3& P, CCVector3& N) override { return false; }
  36. bool interpolateNormalsBC(unsigned triIndex, const CCVector3d& w, CCVector3& N) override { return false; }
  37. bool interpolateColors(unsigned triIndex, const CCVector3& P, ccColor::Rgb& color) override { return false; }
  38. bool interpolateColorsBC(unsigned triIndex, const CCVector3d& w, ccColor::Rgb& color) override { return false; }
  39. bool interpolateColors(unsigned triIndex, const CCVector3& P, ccColor::Rgba& color) override { return false; }
  40. bool interpolateColorsBC(unsigned triIndex, const CCVector3d& w, ccColor::Rgba& color) override { return false; }
  41. bool getColorFromMaterial(unsigned triIndex, const CCVector3& P, ccColor::Rgba& color, bool interpolateColorIfNoTexture) override { return false; }
  42. bool getVertexColorFromMaterial(unsigned triIndex, unsigned char vertIndex, ccColor::Rgba& color, bool returnColorIfNoTexture) override { return false; }
  43. bool hasMaterials() const override { return false; }
  44. const ccMaterialSet* getMaterialSet() const override { return 0; }
  45. int getTriangleMtlIndex(unsigned triangleIndex) const override { return -1; }
  46. bool hasTextures() const override { return false; }
  47. TextureCoordsContainer* getTexCoordinatesTable() const override { return 0; }
  48. void getTriangleTexCoordinates(unsigned triIndex, TexCoords2D* &tx1, TexCoords2D* &tx2, TexCoords2D* &tx3) const override { tx1 = tx2 = tx3 = nullptr; }
  49. bool hasPerTriangleTexCoordIndexes() const override { return false; }
  50. void getTriangleTexCoordinatesIndexes(unsigned triangleIndex, int& i1, int& i2, int& i3) const override { i1 = i2 = i3 = -1; }
  51. bool hasTriNormals() const override { return false; }
  52. void getTriangleNormalIndexes(unsigned triangleIndex, int& i1, int& i2, int& i3) const override { i1 = i2 = i3 = -1; }
  53. bool getTriangleNormals(unsigned triangleIndex, CCVector3& Na, CCVector3& Nb, CCVector3& Nc) const override { return false; }
  54. NormsIndexesTableType* getTriNormsTable() const override { return 0; }
  55. virtual unsigned capacity() const override { return 0; }
  56. virtual bool trianglePicking( const CCVector2d& clickPos,
  57. const ccGLCameraParameters& camera,
  58. int& nearestTriIndex,
  59. double& nearestSquareDist,
  60. CCVector3d& nearestPoint,
  61. CCVector3d* barycentricCoords = nullptr) const override { return false; }
  62. void setGlobalShift(const CCVector3d& shift) override { /* this method shouldn't be called on ccMeshGroup instances */ assert(false); }
  63. void setGlobalScale(double scale) override { /* this method shouldn't be called on ccMeshGroup instances */ assert(false); }
  64. //inherited methods (ccHObject)
  65. bool isSerializable() const override { return true; }
  66. bool toFile_MeOnly(QFile& out, short dataVersion) const override;
  67. bool fromFile_MeOnly(QFile& in, short dataVersion, int flags, LoadedIDMap& oldToNewIDMap) override;
  68. short minimumFileVersion_MeOnly() const override;
  69. //inherited methods (GenericIndexedMesh)
  70. unsigned size() const override { return 0; }
  71. void forEach(genericTriangleAction action) override {}
  72. void placeIteratorAtBeginning() override {}
  73. CCCoreLib::GenericTriangle* _getNextTriangle() override { return 0; }
  74. CCCoreLib::GenericTriangle* _getTriangle(unsigned index) override { return 0; }
  75. CCCoreLib::VerticesIndexes* getNextTriangleVertIndexes() override { return 0; }
  76. CCCoreLib::VerticesIndexes* getTriangleVertIndexes(unsigned triangleIndex) override { return 0; }
  77. void getTriangleVertices(unsigned triangleIndex, CCVector3& A, CCVector3& B, CCVector3& C) const override {}
  78. void getBoundingBox(CCVector3& bbMin, CCVector3& bbMax) override {}
  79. protected:
  80. //inherited from ccHObject
  81. virtual void drawMeOnly(CC_DRAW_CONTEXT& context) override;
  82. };
  83. #endif //CC_MESH_GROUP_HEADER