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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18 * a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <Inventor/draggers/SoDragger.h>
28#include <Inventor/fields/SoSFVec3f.h>
29
30class SoSensor;
31class SoFieldSensor;
32class SbLineProjector;
34
35
36class COIN_DLL_API SoTabPlaneDragger : public SoDragger {
37 typedef SoDragger inherited;
38
39 SO_KIT_HEADER(SoTabPlaneDragger);
40
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
60
61public:
62 static void initClass(void);
64
67
68 void adjustScaleTabSize(void);
69
70protected:
71
73
74 virtual void GLRender(SoGLRenderAction * action);
75
76 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
77 virtual void setDefaultOnNonWritingFields(void);
78
79 void reallyAdjustScaleTabSize(SoGLRenderAction * action);
80
81 void getXYScreenLengths(SbVec2f & lengths, const SbMatrix & localtoscreen,
82 const SbVec2s & winsize);
83
84 void dragStart(void);
85 void drag(void);
86 void dragFinish(void);
87
88 // Lots of public/protected methods and members were removed from
89 // this class as they clearly should have been private.
90 // Let us know if we've removed something that you need.
91 // pederb, 20000226
92
93private:
94
95 // static methods moved from public to private
96 static void startCB(void * f, SoDragger * d);
97 static void motionCB(void * f, SoDragger * d);
98 static void finishCB(void * f, SoDragger * d);
99 static void metaKeyChangeCB(void * f, SoDragger * d);
100 static void fieldSensorCB(void * f, SoSensor * s);
101 static void valueChangedCB(void * f, SoDragger * d);
102
103 void createPrivateParts(void);
104 SoNode *getNodeFieldNode(const char *fieldname);
105
106 SoFieldSensor * scaleFieldSensor;
107 SoFieldSensor * translFieldSensor;
108 SbLineProjector *lineProj;
109 SbPlaneProjector *planeProj;
110 int whatkind;
111 int constraintState;
112 float prevsizex;
113 float prevsizey;
114 SbBool adjustTabs;
115 SbVec3f worldRestartPt;
116 SbVec3f scaleCenter;
117};
118
119#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:36
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition: SbVec2s.h:37
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
The SoDragger class is the base class for all draggers.
Definition: SoDragger.h:53
static void initClass(void)
Definition: SoDragger.cpp:388
virtual void setDefaultOnNonWritingFields(void)
Definition: SoDragger.cpp:1743
virtual void GLRender(SoGLRenderAction *action)
Definition: SoDragger.cpp:505
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:39
virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways=0)
Definition: SoInteractionKit.cpp:648
static void fieldSensorCB(void *, SoSensor *)
Definition: SoInteractionKit.cpp:725
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:36
SoSFVec3f translation
Definition: SoTabPlaneDragger.h:65
SoSFVec3f scaleFactor
Definition: SoTabPlaneDragger.h:66

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Wed Jan 18 2023 for Coin by Doxygen. 1.9.6