16 #ifndef SURGSIM_GRAPHICS_PAINTBEHAVIOR_H 17 #define SURGSIM_GRAPHICS_PAINTBEHAVIOR_H 19 #include "SurgSim/Collision/Representation.h" 20 #include "SurgSim/DataStructures/IndexedLocalCoordinate.h" 21 #include "SurgSim/Framework/Behavior.h" 22 #include "SurgSim/Framework/Component.h" 23 #include "SurgSim/Framework/Logger.h" 24 #include "SurgSim/Graphics/OsgMeshRepresentation.h" 25 #include "SurgSim/Graphics/OsgTexture2d.h" 34 SURGSIM_STATIC_REGISTRATION(PaintBehavior);
83 void setCoordinates(
const std::vector<DataStructures::IndexedLocalCoordinate>& coordinate);
88 void update(
double dt)
override;
93 void buildBrush(
double radius);
96 void buildAntiAliasedBrush(
double radius);
105 std::shared_ptr<Graphics::OsgMeshRepresentation> m_representation;
108 std::shared_ptr<Graphics::OsgTexture2d> m_texture;
126 std::vector<DataStructures::IndexedLocalCoordinate> m_coordinates;
133 boost::mutex m_mutex;
139 #endif // SURGSIM_GRAPHICS_PAINTBEHAVIOR_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void setRepresentation(std::shared_ptr< Framework::Component > representation)
Sets graphics representation being painted on.
Definition: PaintBehavior.cpp:46
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
bool doWakeUp() override
Interface to be implemented by derived classes.
Definition: PaintBehavior.cpp:134
void update(double dt) override
Update the behavior.
Definition: PaintBehavior.cpp:169
void setRadius(double radius)
Sets radius of paint splat.
Definition: PaintBehavior.cpp:201
void setCoordinates(const std::vector< DataStructures::IndexedLocalCoordinate > &coordinate)
Sets collection of local triangle coordinates to paint on during next update.
Definition: PaintBehavior.cpp:85
void setTextureSize(int width, int height)
Sets the size of the texture layer to paint onto.
Definition: PaintBehavior.cpp:91
Eigen::Matrix< double, 2, 1 > Vector2d
A 2D vector of doubles.
Definition: Vector.h:53
double getRadius() const
Gets radius of paint splat.
Definition: PaintBehavior.cpp:206
std::shared_ptr< Graphics::OsgMeshRepresentation > getRepresentation() const
Gets graphics representation being painted on.
Definition: PaintBehavior.cpp:52
Definitions of small fixed-size square matrix types.
Definitions of small fixed-size vector types.
Behaviors perform actions.
Definition: Behavior.h:40
void setAntiAlias(bool antialias)
Sets whether to anti-alias the brush.
Definition: PaintBehavior.cpp:67
bool getAntiAlias() const
Gets status of antialiased brush.
Definition: PaintBehavior.cpp:80
void setColor(const Math::Vector4d &color)
Sets color of the paint.
Definition: PaintBehavior.cpp:57
Math::Vector4d getColor() const
Gets color of the paint.
Definition: PaintBehavior.cpp:62
Behavior class to allow a specified scene element to receive painting effects.
Definition: PaintBehavior.h:37
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dynamic size matrix.
Definition: Matrix.h:65
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: PaintBehavior.cpp:105