31#define HANDLE_DIAMETER 15
77 virtual bool MouseEvent(
int buttonNum, std::vector<double> screenCoords,
double handleMidpoint[3],
bool release =
false) = 0;
82 virtual void GetBox(std::vector<double> &llc, std::vector<double> &urc)
const = 0;
108 virtual void _mousePress(
double screenCoords[2],
double handleMidpoint[3],
int buttonNum) = 0;
113 virtual void _mouseDrag(
double screenCoords[2],
double handleMidpoint[3]) = 0;
158 virtual bool MouseEvent(
int buttonNum, std::vector<double> screenCoords,
double handleMidpoint[3],
bool release =
false);
161 virtual void GetBox(std::vector<double> &llc, std::vector<double> &urc)
const;
168 int _mouseIsOverHandle(
const double screenCoords[2],
double handleMid[3])
const;
176 virtual void _captureMouseDown(
int handleNum,
int buttonNum,
const double strHandleMid[3]);
182 bool startHandleSlide(
const double mouseCoords[2],
int handleNum);
188 void setMouseDown(
bool downUp) { _mouseDownHere = downUp; }
198 bool projectPointToLine(
const double mouseCoords[2],
double projCoords[2]);
208 bool pixelToVector(
double winCoords[2],
double dirVec[3],
const double strHandleMid[3],
double mouseWorldPos[3] = NULL);
211 virtual void drawBoxFaces()
const;
221 virtual bool pointIsOnQuad(
double cor1[3],
double cor2[3],
double cor3[3],
double cor4[3],
const double pickPt[2])
const;
227 virtual int pointIsOnBox(
double corners[8][3],
const double pkPt[2])
const;
229 double getPixelSize()
const;
233 void transformMatrix(
VAPoR::Transform *transform, std::vector<double> parentScales = {1, 1, 1});
237 void deScaleExtents(
double *extents)
const;
241 void deScaleExtents(
double extents[8][3])
const;
247 void deScaleScalarOnAxis(
float &scalar,
int axis)
const;
255 void drawHitBox(
double winCoord1[2],
double winCoord2[2],
double winCoord3[2],
double winCoord4[2])
const;
261 void drawHandleConnector(
int handleNum,
double *handleExtents,
double *extents);
268 void makeHandleExtents(
int handleNum,
double *handleExtents,
int octant,
double *extents);
275 void drawCubeFaces(
double *handleExtents,
bool isSelected);
283 int makeHandleFaces(
int handleNum,
double handle[8][3],
int octant,
const double *boxExtents)
const;
292 bool _projectPointToWin(
const double cubeCoords[3],
double winCoords[2])
const;
294 void _mousePress(
double screenCoords[2],
double handleMidpoint[3],
int buttonNum);
295 void _mouseDrag(
double screenCoords[2],
double handleMidpoint[3]);
296 void _mouseRelease(
double screenCoords[2]);
297 void _stretchCorners(
double corners[8][3])
const;
298 void _translateCorners(
double corners[8][3])
const;
299 void _moveMinusXCorners(
double corners[8][3])
const;
300 void _moveMinusYCorners(
double corners[8][3])
const;
301 void _moveMinusZCorners(
double corners[8][3])
const;
302 void _movePlusXCorners(
double corners[8][3])
const;
303 void _movePlusYCorners(
double corners[8][3])
const;
304 void _movePlusZCorners(
double corners[8][3])
const;
305 void _constrainExtents();
309 double _handleSizeInScene;
310 double _cameraPosition[3];
311 double _modelViewMatrix[16];
312 double _projectionMatrix[16];
318 float _mouseDownPoint[2];
321 float _handleProjVec[2];
326 double _initialSelectionRay[3];
329 double _tempRotation;
A class that supports manipulators in in a VAPOR Visualizer.
virtual void _stretchCorners(double corners[8][3]) const =0
virtual void _mouseRelease(double screenCoords[2])=0
param[in] screenCoords - coordinates of the cursor upon mose release
virtual void Render()=0
Pure virtual function renders the geometry of the Manip.
static const float _unselectedFaceColor[4]
static const float _faceSelectionColor[4]
virtual void _mouseDrag(double screenCoords[2], double handleMidpoint[3])=0
double _cameraPosition[3]
virtual int _mouseIsOverHandle(const double screenCoords[2], double handleMid[3]) const =0
void _drawCubeFaces(double *extents, bool isSelected)
Manip(GLManager *glManager)
virtual void Update(std::vector< double > llc, std::vector< double > urc, std::vector< double > minExtents, std::vector< double > maxExtents, VAPoR::Transform *rpTransform, VAPoR::Transform *dmTransform, bool constrain)=0
virtual bool MouseEvent(int buttonNum, std::vector< double > screenCoords, double handleMidpoint[3], bool release=false)=0
virtual void _mousePress(double screenCoords[2], double handleMidpoint[3], int buttonNum)=0
virtual void GetBox(std::vector< double > &llc, std::vector< double > &urc) const =0
A Manip subclass for manipulators that stretch and translate.
TranslateStretchManip(GLManager *glManager)
virtual void Update(std::vector< double > llc, std::vector< double > urc, std::vector< double > minExtents, std::vector< double > maxExtents, VAPoR::Transform *rpTransform, VAPoR::Transform *dmTransform, bool constrain)
virtual void GetBox(std::vector< double > &llc, std::vector< double > &urc) const
virtual ~TranslateStretchManip()
virtual void Render()
Pure virtual function renders the geometry of the Manip.
virtual bool MouseEvent(int buttonNum, std::vector< double > screenCoords, double handleMidpoint[3], bool release=false)
Contains references to context scope OpenGL data.