Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoAntiSquish.h
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : Paul Isaacs (MMM yyyy)
25**=======================================================================*/
26/*=======================================================================
27 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
28 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
29 *** ***
30 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
31 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
32 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
33 *** ***
34 *** RESTRICTED RIGHTS LEGEND ***
35 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
36 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
37 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
38 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
39 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
40 *** ***
41 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49
50#ifndef _SO_ANTI_SQUISH_
51#define _SO_ANTI_SQUISH_
52
53#include <Inventor/fields/SoFieldData.h>
54#include <Inventor/nodes/SoNode.h>
55#include <Inventor/nodes/SoTransformation.h>
56#include <Inventor/fields/SoSFBool.h>
57#include <Inventor/fields/SoSFEnum.h>
58
60//
61// Class: SoAntiSquish
62//
63// undoes any uneven scales in the current transformation matrix.
64// during traversal
65//
67
108
109 SO_NODE_HEADER(SoAntiSquish);
110
111 public:
112
117
150
151 // Fields
165
170 void recalc();
171
172 private:
173 virtual void callback(SoCallbackAction *action);
174 virtual void GLRender(SoGLRenderAction *action);
175 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
176 virtual void getMatrix(SoGetMatrixAction *action);
177 virtual void pick(SoPickAction *action);
178
179 // Called by actions that need to change the state with a new matrix.
180 void doAction(SoAction *action);
181
182 private:
183 static void initClass();
184 static void exitClass();
185
186 private:
187 virtual ~SoAntiSquish();
188
189 SbMatrix getUnsquishingMatrix( SbMatrix squishedMatrix, SbBool doInverse,
190 SbMatrix &inverseAnswer );
191
192 private:
193 SbMatrix savedAnswer, savedInverseAnswer;
194
195 SbBool recalcNextTime;
196};
197
198#endif /* _SO_ANTI_SQUISH_ */
199
4x4 matrix class.
Definition SbMatrix.h:309
Abstract base class for all actions.
Definition SoAction.h:132
Transformation node that undoes non-uniform 3D scales.
SoAntiSquish()
Creates an anti-squish node with default settings.
SoSFBool recalcAlways
If recalcAlways is TRUE, this node calculates its unsquishing matrix every time it is traversed.
SoSFEnum sizing
Determines which of the algorithms enumerated by the type Sizing will be used to select the new scale...
void recalc()
Sets a flag so that the next time the node is traversed, it will recalculate its unsquishing matrix.
@ Z
Fits the other two axes to match the Z axis, whose size is unchanged.
@ LONGEST_DIAGONAL
Accounts for shearing; transforms a cube by the matrix and then uses length of longest diagonal.
@ AVERAGE_DIMENSION
Uses average of 3 scales in the matrix.
@ Y
Fits the other two axes to match the Y axis, whose size is unchanged.
@ X
Fits the other two axes to match the X axis, whose size is unchanged.
@ SMALLEST_DIMENSION
Uses smallest of 3 scales in the matrix.
@ BIGGEST_DIMENSION
Uses biggest of 3 scales in the matrix.
Performs a generic traversal of a scene graph or path.
Renders a scene graph using Open Inventor's Render Engine.
Computes bounding box of a scene.
Computes transformation matrix for a subgraph.
Abstract base class for picking objects in a scene.
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an enumerated value.
Definition SoSFEnum.h:89
Abstract base class for all geometric transformation nodes.
int SbBool
Boolean type.
Definition SbBase.h:87