9 #include <osgGA/GUIEventAdapter> 10 #include <osgViewer/View> 13 #include <osg/Matrixd> 18 #include "DraggableWire.h" 33 static QColor
getQColor(
const osg::Vec4f& color);
53 osg::Matrix& VPW, osg::Matrix& invVPW);
63 static void getFarNear(
double x,
double y,
const osg::Matrix& invVPW,
64 osg::Vec3f& near, osg::Vec3f& far);
77 const osg::Vec3f& nearPoint,
const osg::Vec3f& farPoint, osg::Vec3f& P,
bool isLine =
false);
92 static bool getLocalFromGlobal(
const osg::Vec3f& P,
const osg::Matrix& invM, osg::Vec3f& p);
96 static bool getGlobalFromLocal(
const osg::Vec3f& p,
const osg::Matrix& M, osg::Vec3f& P);
105 static double getAngleTwoVectors(
const osg::Vec2f& p1,
const osg::Vec2f& p2,
const osg::Vec2f& p3,
const osg::Vec2f& p4);
113 static osg::Vec3f
rotate2DPointAround(
const osg::Vec3f& center,
float theta,
const osg::Vec3f& original);
131 const osg::Vec3f& farPoint,
const osg::Vec3f& nearPoint,
132 const osg::Vec3f& normal, osg::Vec3f& X1);
138 const osg::Vec3d &v1,
const osg::Vec3d &v2);
151 static bool getLinesIntersection(
const osg::Vec3f& La1,
const osg::Vec3f& La2,
const osg::Vec3f& Lb1,
const osg::Vec3f& Lb2,
152 osg::Vec3f& intersection);
162 osg::Vec3f& p1, osg::Vec3f& p2, osg::Vec3f& p3, osg::Vec3f& p4);
172 static osg::Vec3f
projectPointOnLine(
const osg::Vec3f& iP,
const osg::Vec3f& u,
const osg::Vec3f& P);
209 #endif // UTILITIES_H Some generic methods compiled into one class. Methods that describe:
Definition: Utilities.h:28
static bool getViewProjectionWorld(osgGA::GUIActionAdapter &aa, osg::Matrix &VPW, osg::Matrix &invVPW)
Definition: Utilities.cpp:98
static osg::Vec4f getOsgColor(const QColor &color)
Definition: Utilities.cpp:18
static osg::Vec3f rotate2DPointAround(const osg::Vec3f ¢er, float theta, const osg::Vec3f &original)
Definition: Utilities.cpp:221
static bool getCameraPosition(entity::SVMData *svm, osg::Vec3f &eye, osg::Vec3f ¢er, osg::Vec3f &up)
Definition: Utilities.cpp:589
static QColor getQColor(const osg::Vec4f &color)
Definition: Utilities.cpp:13
static int getPlanesIntersection(entity::Canvas *canvas1, entity::Canvas *canvas2, osg::Vec3f &iP, osg::Vec3f &u)
Definition: Utilities.cpp:390
static double distanceTwoPoints(const osg::Vec3f &P1, const osg::Vec3f &P2)
Definition: Utilities.cpp:459
static double getSkewLinesDistance(const osg::Vec3d &r1, const osg::Vec3d &r2, const osg::Vec3d &v1, const osg::Vec3d &v2)
Definition: Utilities.cpp:271
static void getFarNear(double x, double y, const osg::Matrix &invVPW, osg::Vec3f &near, osg::Vec3f &far)
Definition: Utilities.cpp:129
static double getAngleTwoVectors(const osg::Vec2f &p1, const osg::Vec2f &p2, const osg::Vec2f &p3, const osg::Vec2f &p4)
Definition: Utilities.cpp:209
static bool getLinesIntersection(const osg::Vec3f &La1, const osg::Vec3f &La2, const osg::Vec3f &Lb1, const osg::Vec3f &Lb2, osg::Vec3f &intersection)
Definition: Utilities.cpp:282
MOUSE_MODE
Definition: Settings.h:97
static bool getLocalFromGlobal(const osg::Vec3f &P, const osg::Matrix &invM, osg::Vec3f &p)
Definition: Utilities.cpp:188
static bool areStrokesProjectable(const std::vector< entity::Stroke *> &strokes, entity::Canvas *source, entity::Canvas *target, osg::Camera *camera)
Definition: Utilities.cpp:26
static bool getModel(entity::Canvas *canvas, osg::Matrix &M, osg::Matrix &invM)
Definition: Utilities.cpp:171
static osg::Vec3f getAnchorLineSegment(const osg::Vec3f &P0, const osg::Vec3f &P1)
Definition: Utilities.cpp:467
static int getCanvasesIntersection(entity::Canvas *current, entity::Canvas *previous, osg::Vec3f &p1, osg::Vec3f &p2, osg::Vec3f &p3, osg::Vec3f &p4)
Definition: Utilities.cpp:350
static QCursor getCursorFromMode(cher::MOUSE_MODE mode)
Definition: Utilities.cpp:484
static osg::Vec3f projectPointOnLine(const osg::Vec3f &iP, const osg::Vec3f &u, const osg::Vec3f &P)
Definition: Utilities.cpp:454
static bool getSkewLinesProjection(const osg::Vec3f ¢er, const osg::Vec3f &farPoint, const osg::Vec3f &nearPoint, const osg::Vec3f &normal, osg::Vec3f &X1)
Definition: Utilities.cpp:233
static bool getRayPlaneIntersection(const osg::Plane &plane, const osg::Vec3f ¢er, const osg::Vec3f &nearPoint, const osg::Vec3f &farPoint, osg::Vec3f &P, bool isLine=false)
Definition: Utilities.cpp:135
static bool getGlobalFromLocal(const osg::Vec3f &p, const osg::Matrix &M, osg::Vec3f &P)
Definition: Utilities.cpp:199