Go to the documentation of this file.
16 #ifndef SURGSIM_GRAPHICS_PAINTBEHAVIOR_H
17 #define SURGSIM_GRAPHICS_PAINTBEHAVIOR_H
34 SURGSIM_STATIC_REGISTRATION(PaintBehavior);
83 void setCoordinates(
const std::vector<DataStructures::IndexedLocalCoordinate>& coordinate);
88 void update(
double dt)
override;
139 #endif // SURGSIM_GRAPHICS_PAINTBEHAVIOR_H
void update(double dt) override
Update the behavior.
Definition: PaintBehavior.cpp:167
Behavior class to allow a specified scene element to receive painting effects.
Definition: PaintBehavior.h:38
Definitions of small fixed-size vector types.
std::shared_ptr< Graphics::OsgMeshRepresentation > m_representation
Graphics representation of the mesh to apply behavior to.
Definition: PaintBehavior.h:105
std::shared_ptr< Graphics::OsgTexture2d > m_texture
Image data of the texture to be used as the decal layer.
Definition: PaintBehavior.h:108
std::shared_ptr< Graphics::OsgMeshRepresentation > getRepresentation() const
Gets graphics representation being painted on.
Definition: PaintBehavior.cpp:50
void paint(const Math::Vector2d &coordinates)
Apply paint brush to texture at specified texture coordinates.
Definition: PaintBehavior.cpp:291
bool m_antialias
Flag for antialiasing the brush.
Definition: PaintBehavior.h:123
void buildBrush(double radius)
Builds paint brush at the set radius size.
Definition: PaintBehavior.cpp:209
Behaviors perform actions.
Definition: Behavior.h:41
Definitions of small fixed-size square matrix types.
int m_brushOffsetY
Definition: PaintBehavior.h:129
Math::Matrix m_brush
Definition: PaintBehavior.h:131
Definition: CompoundShapeToGraphics.cpp:30
Math::Vector4d getColor() const
Gets color of the paint.
Definition: PaintBehavior.cpp:60
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: PaintBehavior.cpp:103
SURGSIM_CLASSNAME(SurgSim::Graphics::PaintBehavior)
double m_radius
Radius of brush.
Definition: PaintBehavior.h:120
boost::mutex m_mutex
Definition: PaintBehavior.h:133
void setAntiAlias(bool antialias)
Sets whether to anti-alias the brush.
Definition: PaintBehavior.cpp:65
void setRepresentation(std::shared_ptr< Framework::Component > representation)
Sets graphics representation being painted on.
Definition: PaintBehavior.cpp:44
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
int m_height
Height of assigned texture.
Definition: PaintBehavior.h:117
bool getAntiAlias() const
Gets status of antialiased brush.
Definition: PaintBehavior.cpp:78
void setColor(const Math::Vector4d &color)
Sets color of the paint.
Definition: PaintBehavior.cpp:55
Eigen::Matrix< double, 2, 1 > Vector2d
A 2D vector of doubles.
Definition: Vector.h:53
int m_width
Width of assigned texture.
Definition: PaintBehavior.h:114
void setRadius(double radius)
Sets radius of paint splat.
Definition: PaintBehavior.cpp:199
double getRadius() const
Gets radius of paint splat.
Definition: PaintBehavior.cpp:204
Math::Vector2d toPixel(const Math::Vector2d &uv)
Convert texture uv coordinates to pixel coordinates.
Definition: PaintBehavior.cpp:277
void buildAntiAliasedBrush(double radius)
Builds an antialiased brush at the set radius size.
Definition: PaintBehavior.cpp:239
int m_brushOffsetX
Definition: PaintBehavior.h:128
void setCoordinates(const std::vector< DataStructures::IndexedLocalCoordinate > &coordinate)
Sets collection of local triangle coordinates to paint on during next update.
Definition: PaintBehavior.cpp:83
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
std::vector< DataStructures::IndexedLocalCoordinate > m_coordinates
Collection of UV texture coordinates to paint to on next update.
Definition: PaintBehavior.h:126
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: PaintBehavior.cpp:132
PaintBehavior(const std::string &name)
Definition: PaintBehavior.cpp:31
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
Math::Vector4d m_color
Color to use for decal painting.
Definition: PaintBehavior.h:111
void setTextureSize(int width, int height)
Sets the size of the texture layer to paint onto.
Definition: PaintBehavior.cpp:89