19 class GenericProgressCallback;
114 double Nc[3])
const {
120 Eigen::Vector3d& Nc)
const {
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,
226 int& nearestTriIndex,
227 double& nearestSquareDist,
229 CCVector3d* barycentricCoords =
nullptr)
const;
236 CCVector3d* barycentricCoords =
nullptr)
const;
243 bool warningIfOutside =
true)
const;
283 CCVector3d* barycentricCoords =
nullptr)
const;
Array of compressed 3D normals (single index)
Array of 2D texture coordinates.
virtual bool hasNormals() const
Returns whether normals are enabled or not.
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)
bool updateTextures(const std::string &texture_file)
virtual bool materialsShown() const
Sets whether textures/material should be displayed or not.
void showNormals(bool state) override
Sets normals visibility.
bool updateTextures(const std::vector< std::string > &texture_files)
virtual bool hasTextures() const =0
Returns whether textures are available for this mesh.
void importParametersFrom(const ccGenericMesh *mesh)
Imports the parameters from another mesh.
virtual void showWired(bool state)
Sets whether mesh should be displayed as a wire or with plain facets.
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
virtual bool triNormsShown() const
Returns whether per-triangle normals are shown or not.
static CCVector3 * GetNormalsBuffer()
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 bool trianglePicking(unsigned triIndex, const CCVector2d &clickPos, const ccGLMatrix &trans, bool noGLTrans, const ccGenericPointCloud &vertices, const ccGLCameraParameters &camera, CCVector3d &point, CCVector3d *barycentricCoords=nullptr) const
Triangle picking (single triangle)
virtual void getTriangleTexCoordinatesIndexes(unsigned triangleIndex, int &i1, int &i2, int &i3) const =0
Returns the triplet of tex coords indexes for a given triangle.
static CCVector3 * GetVertexBuffer()
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.
ccPointCloud * samplePoints(bool densityBased, double samplingParameter, bool withNormals, bool withRGB, bool withTexture, cloudViewer::GenericProgressCallback *pDlg=nullptr)
Samples points on a mesh.
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.
const CCVector3d & getGlobalShift() const override
Returns the shift applied to original coordinates.
virtual int getTriangleMtlIndex(unsigned triangleIndex) const =0
Returns a given triangle material indexes.
bool m_showWired
Wireframe display mode.
short minimumFileVersion_MeOnly() const override
virtual ccGenericPointCloud * getAssociatedCloud() const =0
Returns the vertices cloud.
double getGlobalScale() const override
Returns the scale applied to original coordinates.
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.
static unsigned * GetWireVertexIndexes()
Returns a pre-initialized array of vertex indexes for wired display.
virtual bool getVertexColorFromMaterial(unsigned triIndex, unsigned char vertIndex, ecvColor::Rgb &C, bool returnColorIfNoTexture)=0
virtual void computeInterpolationWeights(unsigned triIndex, const CCVector3 &P, CCVector3d &weights) const
Returns the (barycentric) interpolation weights for a given triangle.
virtual void getTriangleTexCoordinates(unsigned triIndex, TexCoords2D *&tx1, TexCoords2D *&tx2, TexCoords2D *&tx3) const =0
Returns per-triangle texture coordinates (pointer to)
virtual bool trianglePicking(const CCVector2d &clickPos, const ccGLCameraParameters &camera, int &nearestTriIndex, double &nearestSquareDist, CCVector3d &nearestPoint, CCVector3d *barycentricCoords=nullptr) const
Brute force triangle picking.
void setGlobalShift(const CCVector3d &shift) override
Sets shift applied to original coordinates (information storage only)
bool m_materialsShown
Texture/material display flag.
bool computePointPosition(unsigned triIndex, const CCVector2d &uv, CCVector3 &P, bool warningIfOutside=true) const
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.
void handleColorRamp(CC_DRAW_CONTEXT &context)
Handles the color ramp display.
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
ccGenericMesh(QString name=QString())
Default constructor.
static ecvColor::Rgb * GetColorsBuffer()
virtual void getTexCoordinates(unsigned index, TexCoords2D *&tx) const =0
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
static bool IsCloudVerticesOfMesh(ccGenericPointCloud *cloud, ccGenericMesh **mesh=nullptr)
Helper to determine if the input cloud acts as vertices of a mesh.
void drawMeOnly(CC_DRAW_CONTEXT &context) override
Enables (OpenGL) stipple mask.
virtual bool trianglePicking(unsigned triIndex, const CCVector2d &clickPos, const ccGLCameraParameters &camera, CCVector3d &point, CCVector3d *barycentricCoords=nullptr) const
Triangle picking (single triangle)
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
void setGlobalScale(double scale) override
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.)
Mesh (triangle) material.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
Shifted entity interface.
A generic mesh with index-based vertex access.
Generic file read and write utility for python interface.
OpenGL camera parameters.