class mrpt::viz::CSetOfTexturedTriangles
Python API: mrpt.viz.CSetOfTexturedTriangles
Overview
A set of textured triangles.
This class can be used to draw any solid, arbitrarily complex object with textures.
See also:
opengl::Scene
#include <mrpt/viz/CSetOfTexturedTriangles.h> class CSetOfTexturedTriangles: public mrpt::viz::CVisualObject, public mrpt::viz::VisualObjectParams_TexturedTriangles { public: // typedefs typedef std::shared_ptr<mrpt::viz ::CSetOfTexturedTriangles> Ptr; typedef std::shared_ptr<const mrpt::viz ::CSetOfTexturedTriangles> ConstPtr; typedef std::unique_ptr<mrpt::viz ::CSetOfTexturedTriangles> UniquePtr; typedef std::unique_ptr<const mrpt::viz ::CSetOfTexturedTriangles> ConstUniquePtr; typedef mrpt::viz::TTriangle::Vertex TVertex; typedef mrpt::viz::TTriangle TTriangle; // fields static constexpr const char* className = "mrpt::viz" "::" "CSetOfTexturedTriangles"; // construction CSetOfTexturedTriangles(); // methods static constexpr auto getClassName(); static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); static std::shared_ptr<CObject> CreateObject(); template <typename... Args> static Ptr Create(Args&&... args); template <typename Alloc, typename... Args> static Ptr CreateAlloc( const Alloc& alloc, Args&&... args ); template <typename... Args> static UniquePtr CreateUnique(Args&&... args); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; virtual mrpt::rtti::CObject* clone() const; virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const; void clearTriangles(); size_t getTrianglesCount() const; TTriangle getTriangle(size_t idx) const; void getTriangle( size_t idx, TTriangle& t ) const; void insertTriangle(const TTriangle& t); virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const; };
Inherited Members
public: // typedefs typedef std::shared_ptr<CObject> Ptr; typedef std::shared_ptr<const CObject> ConstPtr; typedef std::unique_ptr<CObject> UniquePtr; typedef std::unique_ptr<const CObject> ConstUniquePtr; typedef std::shared_ptr<CSerializable> Ptr; typedef std::shared_ptr<const CSerializable> ConstPtr; typedef std::shared_ptr<CVisualObject> Ptr; typedef std::shared_ptr<const CVisualObject> ConstPtr; // structs struct BuffersVersion; struct ChangeCounter; struct PoseAndScale; struct State; // methods mrpt::rtti::CObject::Ptr duplicateGetSmartPtr() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; virtual CObject* clone() const = 0; virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); void setName(const std::string& n); std::string getName() const; bool isVisible() const; void setVisibility(bool visible = true); bool castShadows() const; void castShadows(bool doCast); void enableShowName(bool showName = true); bool isShowNameEnabled() const; CVisualObject& setPose(const mrpt::poses::CPose3D& o); CVisualObject& setPose(const mrpt::poses::CPose2D& o); CVisualObject& setPose(const mrpt::math::TPose3D& o); CVisualObject& setPose(const mrpt::math::TPose2D& o); CVisualObject& setPose(const mrpt::poses::CPoint3D& o); CVisualObject& setPose(const mrpt::poses::CPoint2D& o); mrpt::math::TPose3D getPose() const; PoseAndScale getPoseAndScale() const; mrpt::poses::CPose3D getCPose() const; CVisualObject& setLocation(double x, double y, double z); CVisualObject& setLocation(const mrpt::math::TPoint3D& p); mrpt::img::TColorf getColor() const; mrpt::img::TColor getColor_u8() const; CVisualObject& setColorA(const float a); virtual CVisualObject& setColorA_u8(const uint8_t a); float materialShininess() const; void materialShininess(float shininess); float materialSpecularExponent() const; void materialSpecularExponent(float exponent); mrpt::img::TColorf materialEmissive() const; void materialEmissive(const mrpt::img::TColorf& color); CVisualObject& setScale(float s); CVisualObject& setScale(float sx, float sy, float sz); float getScaleX() const; float getScaleY() const; float getScaleZ() const; CVisualObject& setColor(const mrpt::img::TColorf& c); CVisualObject& setColor(float R, float G, float B, float A = 1); virtual CVisualObject& setColor_u8(const mrpt::img::TColor& c); CVisualObject& setColor_u8(uint8_t R, uint8_t G, uint8_t B, uint8_t A = 255); virtual bool cullElegible() const; virtual void toYAMLMap(mrpt::containers::yaml& propertiesMap) const; virtual bool isCompositeObject() const; virtual const std::deque<std::shared_ptr<CVisualObject>>& getInternalChildren() const; void notifyChange() const; void notifyTransformChange() const; void clearChangedFlag() const; void notifyBBoxChange() const; bool hasToUpdateBuffers() const; uint64_t dataVersion() const; uint64_t transformVersion() const; bool hasToUpdateBuffersSince(uint64_t sinceVersion) const; void updateBuffersIfNeeded() const; virtual void updateBuffers() const; virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const; auto getBoundingBox() const; auto getBoundingBoxLocal() const; auto getBoundingBoxLocalf() const; virtual mrpt::math::TPoint3Df getLocalRepresentativePoint() const; void setLocalRepresentativePoint(const mrpt::math::TPoint3Df& p); mrpt::viz::CText& labelObject() const; std::shared_ptr<mrpt::viz::CText> labelObjectPtr() const; const auto& shaderTexturedTrianglesBuffer() const; auto& shaderTexturedTrianglesBufferMutex() const; void assignImage(const mrpt::img::CImage& img, const mrpt::img::CImage& imgAlpha); void assignImage(const mrpt::img::CImage& img); void assignImage(mrpt::img::CImage&& img, mrpt::img::CImage&& imgAlpha); void assignImage(mrpt::img::CImage&& img); bool isLightEnabled() const; void enableLight(bool enable = true); void cullFaces(const TCullFace& cf); TCullFace cullFaces() const; const mrpt::img::CImage& getTextureImage() const; const mrpt::img::CImage& getTextureAlphaImage() const; bool textureImageHasBeenAssigned() const; void setAlphaMode(TAlphaMode mode); TAlphaMode alphaMode() const; void setAlphaCutoff(float cutoff); float alphaCutoff() const; float effectiveAlphaCutoff() const; void assignNormalMap(const mrpt::img::CImage& img); void assignNormalMap(mrpt::img::CImage&& img); const mrpt::img::CImage& getNormalMapImage() const; bool normalMapHasBeenAssigned() const; void assignEmissiveMap(const mrpt::img::CImage& img); void assignEmissiveMap(mrpt::img::CImage&& img); const mrpt::img::CImage& getEmissiveMapImage() const; bool emissiveMapHasBeenAssigned() const; void enableTextureLinearInterpolation(bool enable); bool textureLinearInterpolation() const; void enableTextureMipMap(bool enable); bool textureMipMap() const;
Typedefs
typedef std::shared_ptr<mrpt::viz ::CSetOfTexturedTriangles> Ptr
A type for the associated smart pointer.
Methods
virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const
Returns information about the class of an object in runtime.
virtual mrpt::rtti::CObject* clone() const
Returns a deep copy (clone) of the object, indepently of its class.
virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const
Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent.
virtual bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const
Simulation of ray-trace, given a pose.
Returns true if the ray effectively collisions with the object (returning the distance to the origin of the ray in “dist”), or false in other case. “dist” variable yields undefined behaviour when false is returned