1#ifndef SOGUIPLANEVIEWERP_H 2#define SOGUIPLANEVIEWERP_H 3 4// @configure_input@ 5 6/**************************************************************************\ 7 * Copyright (c) Kongsberg Oil & Gas Technologies AS 8 * All rights reserved. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions are 12 * met: 13 * 14 * Redistributions of source code must retain the above copyright notice, 15 * this list of conditions and the following disclaimer. 16 * 17 * Redistributions in binary form must reproduce the above copyright 18 * notice, this list of conditions and the following disclaimer in the 19 * documentation and/or other materials provided with the distribution. 20 * 21 * Neither the name of the copyright holder nor the names of its 22 * contributors may be used to endorse or promote products derived from 23 * this software without specific prior written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36\**************************************************************************/ 37 38#ifndef SO@GUI@_INTERNAL 39#error this is a private header file 40#endif /* !SO@GUI@_INTERNAL */ 41 42#include <Inventor/SbLinear.h> 43 44class So@Gui@PlaneViewer; 45 46// ************************************************************************ 47 48// This class contains private data and methods used within the 49// SoGuiPlaneViewer class. 50 51class SoGuiPlaneViewerP 52{ 53public: 54 ~SoGuiPlaneViewerP(); 55 56 void commonConstructor(void); 57 58 void pan(const SbVec2f & thispos, const SbVec2f & prevpos); 59 void rotateZ(const float angle) const; 60 61 void viewPlaneX(void) const; 62 void viewPlaneY(void) const; 63 void viewPlaneZ(void) const; 64 65 void setCanvasSize(const SbVec2s size); 66 void setPointerLocation(const SbVec2s location); 67 int getPointerXMotion(void) const; 68 int getPointerYMotion(void) const; 69 float getPointerOrigoAngle(void) const; 70 float getPointerOrigoMotionAngle(void) const; 71 72 void updateAnchorScenegraph(void) const; 73 74 enum PlaneViewerMode { 75 SCENEGRAPH_INTERACT_MODE, 76 77 IDLE_MODE, 78 79 DOLLY_MODE, 80 TRANSLATE_MODE, 81 82 ROTZ_WAIT_MODE, 83 ROTZ_MODE, 84 85 SEEK_WAIT_MODE, 86 SEEK_MODE 87 } mode; 88 89 void changeMode(PlaneViewerMode newmode); 90 void setCursorRepresentation(PlaneViewerMode mode); 91 92 struct pointerdata { 93 SbVec2s now; 94 SbVec2s then; 95 } pointer; 96 SbVec2s canvas; 97 98 SbBool ctrldown; 99 SbBool shiftdown; 100 SbBool button1down; 101 SbBool button3down; 102 103 SbPlane panningplane; 104 105 class SoDrawStyle * lineds[2]; 106 107 class SoNode * superimposition; 108 struct superdata { 109 class SoCoordinate3 * coords; 110 class SoOrthographicCamera * camera; 111 } super; 112 113protected: 114 SoGuiPlaneViewerP(So@Gui@PlaneViewer * publ); 115 So@Gui@PlaneViewer * pub; 116}; 117 118// ************************************************************************ 119 120#endif // ! SOGUIPLANEVIEWERP_H 121