MeVisLab Toolbox Reference
CSOBulgeAction.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2012, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13
15
16#pragma once
17
18#include "CSOPointingAction.h"
19
22
24
26{
27public:
28
30
31 bool isSensitiveAt(const SoPointerPosition& pos) override;
32
33 void startPressAt(const SoPointerPosition& pos) override;
34 void dragMoveTo(const SoPointerPosition& pos) override;
35 SoPointingAction* endPress(int clickCount) override;
36
37 int getCurrentCursor(SoViewerProxy* ) const override;
38
42
43 void setMode(int mode) override;
44 int getNumModes() const override;
45
47 {
48 const SbVec3f& pointerPos = pos.getView2DPosition()->getVoxelPosition();
49 const SbVec2f& viewportStart = pos.getView2DPosition()->getViewportOrigin();
50 const SbVec2f& viewportEnd = viewportStart + pos.getView2DPosition()->getViewportSize();
51
52 return (pointerPos[0] >= viewportStart[0]) &&
53 (pointerPos[1] >= viewportStart[1]) &&
54 (pointerPos[0] <= viewportEnd[0]) &&
55 (pointerPos[1] <= viewportEnd[1]);
56 }
57
58protected:
59
61
63 bool isEligibleForBulging(ml::CSO* cso, View2DSliceList* slicelist, SoCSOBulgeEditor* bulgeEditor);
64
69 unsigned int _hitPathPointIndex;
72
74 SbVec3f _sliceNormal;
75
77
79};
80
SbVec3f _initialPosition
void initializeMembers()
bool isInViewportRegion(const SoPointerPosition &pos) const
ml::CSOPathPoints * _hitPathPoints
unsigned int _hitPathPointIndex
SoCSOBulgeEditor * _hitEditor
void startPressAt(const SoPointerPosition &pos) override
ml::CSO * _hitCSO
void setInteractOnlyWithSelectedCSO(bool flag)
ml::CSOSeedPoint * _hitSeedPoint
int getNumModes() const override
CSOBulgeAction(SoView2DCSOExtensibleEditor *editor)
SoPointingAction * endPress(int clickCount) override
bool _interactOnlyWithSelectedCSOs
bool isAllowedToDrag(const SoPointerPosition &pos)
void dragMoveTo(const SoPointerPosition &pos) override
Continues the drag to given device position.
bool isSensitiveAt(const SoPointerPosition &pos) override
ml::CSOList * _hitCSOList
void setMode(int mode) override
bool isEligibleForBulging(ml::CSO *cso, View2DSliceList *slicelist, SoCSOBulgeEditor *bulgeEditor)
int getCurrentCursor(SoViewerProxy *) const override
CSOPointingAction(SoView2DCSOExtensibleEditor *editor, const std::string &id)
Extension for bulging any type of CSO in an influence radius.
SoPointerPosition manages the current position of the mouse cursor.
const View2DPosition * getView2DPosition() const
Returns the additional data as View2DPosition. Legacy support, rather use get<View2DPosition>().
SoPointingAction(SoInteractionOwner *owner, std::string id, bool positionSensitive=true)
SbVec3f getVoxelPosition() const
Return voxel position of pointer.
SbVec2f getViewportOrigin() const
Return view port origin of current slice in voxel coordinates.
SbVec2f getViewportSize() const
Return view port size of current slice in voxel coordinates.
a list that holds all View2DSlice objects (lazily created) of a SoView2D
Definition CSO.h:44