Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoTabPlaneDragger.h
1#ifndef COIN_SOTABPLANEDRAGGER_H
2#define COIN_SOTABPLANEDRAGGER_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
28#include <Inventor/tools/SbLazyPimplPtr.h>
29#include <Inventor/fields/SoSFVec3f.h>
30
31class SoSensor;
32class SoFieldSensor;
33class SbLineProjector;
35class SoTabPlaneDraggerP;
36
37class COIN_DLL_API SoTabPlaneDragger : public SoDragger {
38 typedef SoDragger inherited;
39
40 SO_KIT_HEADER(SoTabPlaneDragger);
41 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleCoords);
42 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab0);
43 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab1);
44 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab2);
45 SO_KIT_CATALOG_ENTRY_HEADER(cornerScaleTab3);
46 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleCoords);
47 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab0);
48 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab1);
49 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab2);
50 SO_KIT_CATALOG_ENTRY_HEADER(edgeScaleTab3);
51 SO_KIT_CATALOG_ENTRY_HEADER(planeSwitch);
52 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabHints);
53 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterial);
54 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabMaterialBinding);
55 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormal);
56 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabNormalBinding);
57 SO_KIT_CATALOG_ENTRY_HEADER(scaleTabs);
58 SO_KIT_CATALOG_ENTRY_HEADER(translator);
59
60public:
61 static void initClass(void);
63
66
67 void adjustScaleTabSize(void);
68
69protected:
70 virtual ~SoTabPlaneDragger(void);
71
72 virtual void GLRender(SoGLRenderAction * action);
73
74 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
75 virtual void setDefaultOnNonWritingFields(void);
76
77 void reallyAdjustScaleTabSize(SoGLRenderAction * action);
78
79 void getXYScreenLengths(SbVec2f & lengths, const SbMatrix & localtoscreen,
80 const SbVec2s & winsize);
81
82 void dragStart(void);
83 void drag(void);
84 void dragFinish(void);
85
86 // Lots of public/protected methods and members were removed from
87 // this class as they clearly should have been private.
88 // Let us know if we've removed something that you need.
89 // pederb, 20000226
90
91private:
92
93 // static methods moved from public to private
94 static void startCB(void * f, SoDragger * d);
95 static void motionCB(void * f, SoDragger * d);
96 static void finishCB(void * f, SoDragger * d);
97 static void metaKeyChangeCB(void * f, SoDragger * d);
98 static void fieldSensorCB(void * f, SoSensor * s);
99 static void valueChangedCB(void * f, SoDragger * d);
100
101 void createPrivateParts(void);
102 SoNode *getNodeFieldNode(const char *fieldname);
103
104 SoFieldSensor * scaleFieldSensor;
105 SoFieldSensor * translFieldSensor;
106 SbLineProjector *lineProj;
107 SbPlaneProjector *planeProj;
108 int whatkind;
109 int constraintState;
110 float prevsizex;
111 float prevsizey;
112 SbBool adjustTabs;
113 SbVec3f worldRestartPt;
114 SbVec3f scaleCenter;
115
116private:
117 SbLazyPimplPtr<SoTabPlaneDraggerP> pimpl;
118
119 // NOT IMPLEMENTED:
121 SoTabPlaneDragger & operator = (const SoTabPlaneDragger & rhs);
122}; // SoTabPlaneDragger
123
124#endif // !COIN_SOTABPLANEDRAGGER_H
The SbLineProjector class projects 2D points to 3D points along a line.
Definition SbLineProjector.h:32
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition SbMatrix.h:37
The SbPlaneProjector class projects 2D points to 3D points in a plane.
Definition SbPlaneProjector.h:31
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:39
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition SbVec2s.h:41
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:40
The SoDragger class is the base class for all draggers.
Definition SoDragger.h:55
static void initClass(void)
Definition SoDragger.cpp:399
virtual void setDefaultOnNonWritingFields(void)
Definition SoDragger.cpp:1791
virtual void GLRender(SoGLRenderAction *action)
Definition SoDragger.cpp:516
The SoFieldSensor class detects changes to a field.
Definition SoFieldSensor.h:29
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition SoGLRenderAction.h:41
static void fieldSensorCB(void *, SoSensor *)
Definition SoInteractionKit.cpp:742
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=FALSE)
Definition SoInteractionKit.cpp:665
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:47
The SoSFVec3f class is a container for an SbVec3f vector.
Definition SoSFVec3f.h:31
The SoSensor class is the abstract base class for all sensors.
Definition SoSensor.h:34
The SoTabPlaneDragger class is a dragger you can translate and scale within a plane.
Definition SoTabPlaneDragger.h:37
SoSFVec3f translation
Definition SoTabPlaneDragger.h:64
SoSFVec3f scaleFactor
Definition SoTabPlaneDragger.h:65

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.