19 class GenericProgressCallback;
114 double Nc[3])
const {
120 Eigen::Vector3d& Nc)
const {
128 virtual void computeInterpolationWeights(
unsigned triIndex,
163 bool interpolateColorIfNoTexture) = 0;
174 unsigned char vertIndex,
176 bool returnColorIfNoTexture) = 0;
182 virtual void showWired(
bool state) { m_showWired = state; }
189 virtual void showPoints(
bool state) { m_showPoints = state; }
212 double samplingParameter,
224 virtual bool trianglePicking(
const CCVector2d& clickPos,
226 int& nearestTriIndex,
227 double& nearestSquareDist,
229 CCVector3d* barycentricCoords =
nullptr)
const;
232 virtual bool trianglePicking(
unsigned triIndex,
236 CCVector3d* barycentricCoords =
nullptr)
const;
240 bool computePointPosition(
unsigned triIndex,
243 bool warningIfOutside =
true)
const;
258 bool updateTextures(
const std::string& texture_file);
259 bool updateTextures(
const std::vector<std::string>& texture_files);
263 bool toFile_MeOnly(QFile& out,
short dataVersion)
const override;
268 LoadedIDMap& oldToNewIDMap)
override;
276 virtual bool trianglePicking(
unsigned triIndex,
283 CCVector3d* barycentricCoords =
nullptr)
const;
288 static unsigned* GetWireVertexIndexes();
Array of compressed 3D normals (single index)
Array of 2D texture coordinates.
virtual bool hasNormals() const
Returns whether normals are enabled or not.
virtual void showNormals(bool state)
Sets normals visibility.
Float version of ccGLMatrixTpl.
virtual TextureCoordsContainer * getTexCoordinatesTable() const =0
Returns per-triangle texture coordinates array.
virtual bool getTriangleNormals(unsigned triangleIndex, double Na[3], double Nb[3], double Nc[3]) const
virtual void showPoints(bool state)
virtual bool materialsShown() const
Sets whether textures/material should be displayed or not.
virtual bool hasTextures() const =0
Returns whether textures are available for this mesh.
virtual void showWired(bool state)
Sets whether mesh should be displayed as a wire or with plain facets.
virtual bool triNormsShown() const
Returns whether per-triangle normals are shown or not.
virtual void getTriangleNormalIndexes(unsigned triangleIndex, int &i1, int &i2, int &i3) const =0
Returns a triplet of normal indexes for a given triangle (if any)
~ccGenericMesh() override=default
Destructor.
bool m_triNormsShown
Per-triangle normals display flag.
virtual bool isShownAsWire() const
Returns whether the mesh is displayed as wired or with plain facets.
virtual bool hasPerTriangleTexCoordIndexes() const =0
Returns whether this mesh as per-triangle triplets of tex coords indexes.
virtual void getTriangleTexCoordinatesIndexes(unsigned triangleIndex, int &i1, int &i2, int &i3) const =0
Returns the triplet of tex coords indexes for a given triangle.
virtual const ccMaterialSet * getMaterialSet() const =0
bool m_stippling
Polygon stippling state.
virtual bool hasTriNormals() const =0
Returns whether the mesh has per-triangle normals.
virtual bool getTriangleNormals(unsigned triangleIndex, CCVector3 &Na, CCVector3 &Nb, CCVector3 &Nc) const =0
Returns a given triangle normal.
virtual bool interpolateNormalsBC(unsigned triIndex, const CCVector3d &w, CCVector3 &N)=0
Interpolates normal(s) inside a given triangle.
bool isSerializable() const override
Returns whether object is serializable of not.
virtual int getTriangleMtlIndex(unsigned triangleIndex) const =0
Returns a given triangle material indexes.
bool m_showWired
Wireframe display mode.
virtual ccGenericPointCloud * getAssociatedCloud() const =0
Returns the vertices cloud.
virtual bool interpolateColors(unsigned triIndex, const CCVector3 &P, ecvColor::Rgb &C)=0
Interpolates RGB colors inside a given triangle.
void enableStippling(bool state)
Enables polygon stippling.
virtual bool getVertexColorFromMaterial(unsigned triIndex, unsigned char vertIndex, ecvColor::Rgb &C, bool returnColorIfNoTexture)=0
virtual void getTriangleTexCoordinates(unsigned triIndex, TexCoords2D *&tx1, TexCoords2D *&tx2, TexCoords2D *&tx3) const =0
Returns per-triangle texture coordinates (pointer to)
bool m_materialsShown
Texture/material display flag.
virtual void showMaterials(bool state)
Sets whether textures should be displayed or not.
virtual bool isShownAsPoints() const
Returns whether the mesh is displayed as wired or with plain facets.
virtual NormsIndexesTableType * getTriNormsTable() const =0
Returns per-triangle normals shared array.
virtual bool getTriangleNormals(unsigned triangleIndex, Eigen::Vector3d &Na, Eigen::Vector3d &Nb, Eigen::Vector3d &Nc) const
virtual void getTexCoordinates(unsigned index, TexCoords2D *&tx) const =0
bool m_showPoints
points display mode
virtual unsigned capacity() const =0
Returns max capacity.
virtual void refreshBB()=0
Forces bounding-box update.
virtual bool getColorFromMaterial(unsigned triIndex, const CCVector3 &P, ecvColor::Rgb &C, bool interpolateColorIfNoTexture)=0
virtual bool stipplingEnabled() const
Returns whether polygon stippling is enabled or not.
virtual bool hasMaterials() const =0
bool normalsAvailable() const override
Returns whether normals are available.
virtual void showTriNorms(bool state)
Sets whether to show or not per-triangle normals.
A 3D cloud interface with associated features (color, normals, octree, etc.)
virtual void drawMeOnly(CC_DRAW_CONTEXT &context)
Draws the entity only (not its children)
virtual short minimumFileVersion_MeOnly() const
virtual bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
Loads own object data.
virtual bool toFile_MeOnly(QFile &out, short dataVersion) const
Save own object data.
Mesh (triangle) material.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Shifted entity interface.
virtual void setGlobalShift(double x, double y, double z)
Sets shift applied to original coordinates (information storage only)
virtual const CCVector3d & getGlobalShift() const
Returns the shift applied to original coordinates.
virtual void setGlobalScale(double scale)
virtual double getGlobalScale() const
Returns the scale applied to original coordinates.
A generic mesh with index-based vertex access.
Generic file read and write utility for python interface.
OpenGL camera parameters.