2020-02-07 17:04:28 +00:00
|
|
|
#ifndef CSV_RENDER_BRUSHDRAW_H
|
|
|
|
#define CSV_RENDER_BRUSHDRAW_H
|
|
|
|
|
2022-10-10 11:41:36 +00:00
|
|
|
#include <osg/Vec3d>
|
|
|
|
#include <osg/ref_ptr>
|
2020-02-07 17:04:28 +00:00
|
|
|
|
2020-02-15 14:09:49 +00:00
|
|
|
#include "../widget/brushshapes.hpp"
|
2022-10-10 11:41:36 +00:00
|
|
|
|
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Geometry;
|
|
|
|
class Group;
|
|
|
|
}
|
2020-02-07 17:04:28 +00:00
|
|
|
|
|
|
|
namespace CSVRender
|
|
|
|
{
|
|
|
|
class BrushDraw
|
|
|
|
{
|
|
|
|
public:
|
2020-02-15 14:09:49 +00:00
|
|
|
BrushDraw(osg::ref_ptr<osg::Group> parentNode, bool textureMode = false);
|
2020-02-07 17:04:28 +00:00
|
|
|
~BrushDraw();
|
|
|
|
|
2020-02-15 14:09:49 +00:00
|
|
|
void update(osg::Vec3d point, int brushSize, CSVWidget::BrushShape toolShape);
|
2020-02-07 17:04:28 +00:00
|
|
|
void hide();
|
|
|
|
|
|
|
|
private:
|
2020-03-05 18:10:55 +00:00
|
|
|
void buildPointGeometry(const osg::Vec3d& point);
|
2020-02-15 14:09:49 +00:00
|
|
|
void buildSquareGeometry(const float& radius, const osg::Vec3d& point);
|
|
|
|
void buildCircleGeometry(const float& radius, const osg::Vec3d& point);
|
|
|
|
void buildCustomGeometry(const float& radius, const osg::Vec3d& point);
|
2020-02-07 17:04:28 +00:00
|
|
|
float getIntersectionHeight(const osg::Vec3d& point);
|
|
|
|
|
2020-02-15 14:09:49 +00:00
|
|
|
osg::ref_ptr<osg::Group> mParentNode;
|
2020-02-07 17:04:28 +00:00
|
|
|
osg::ref_ptr<osg::Group> mBrushDrawNode;
|
|
|
|
osg::ref_ptr<osg::Geometry> mGeometry;
|
2020-03-05 18:10:55 +00:00
|
|
|
bool mTextureMode;
|
2020-02-15 14:09:49 +00:00
|
|
|
float mLandSizeFactor;
|
2020-02-07 17:04:28 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|