Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HUtilityGeomHandle.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: 4e9d501d91100695d5879e02026d63cd7231db21 $
13 //
14 
18 #ifndef _HUTILITYGEOMHANDLE_H
19 #define _HUTILITYGEOMHANDLE_H
20 
21 #ifdef H_PACK_8
22 #pragma pack(push)
23 #pragma pack(8)
24 #endif
25 
26 #include "HTools.h"
27 #include "HUtilityAnnotation.h"
28 #include "hic_types.h"
29 
30 class HPoint;
31 class HBaseView;
32 
33 
38 {
46 };
47 
48 
49 
51 
59 class MVO_API HUtilityGeomHandle
60 {
61 public:
62 
63 
64  virtual ~HUtilityGeomHandle() { };
65 
67  static void RegisterCallbacks();
68 
75  virtual HC_KEY Insert(HPoint position, bool edges = false, int level = 4);
76 
80  virtual void SetupGeomHandleSegment(bool edges);
81 
89  virtual void ConstrainToPlane(HC_KEY handlekey, HPoint p1, HPoint p2, HPoint p3,HBaseView *view = 0);
90 
94  virtual void ConstrainToViewplane(HC_KEY handlekey,HBaseView *view = 0);
95 
101  virtual void ConstrainToRay(HC_KEY handlekey, HPoint p1, HPoint p2, HBaseView *view = 0);
102 
108  virtual void ConstrainToRotationVector(HC_KEY handlekey, HPoint p1, HPoint p2,HBaseView *view = 0);
109 
115  virtual void ConstrainToScale(HC_KEY handlekey, HPoint p1, HPoint p2,HBaseView *view = 0);
116 
120  virtual void ConstrainToOnOff(HC_KEY handlekey,HBaseView *view = 0);
121 
128  virtual void Move(HC_KEY handlekey, HPoint newposition, HC_KEY camerakey, HBaseView *view = 0);
129 
130 
135  virtual void ShowBasePosition(HC_KEY handlekey, HPoint &bp);
136 
141  virtual void GetConstraintParameters(HC_KEY handlekey);
142 
147  void Rotate(HC_KEY handlekey, float rotangle);
148 
155  virtual float CalculatePlaneZ(HC_KEY handlekey, HPoint point);
156 
157 
164  virtual void AdjustPositionToRay(HC_KEY handlekey, HPoint &C, HPoint A, HPoint B);
165 
175  virtual void CalculatePositionOnPlane(HC_KEY handlekey, HPoint &p, float a, float b, float c, float d);
176 
177 
184  void AdjustPointToRay(HC_KEY geomhandlekey, HPoint &p, HC_KEY camerasegment, HBaseView *view);
185 
196  virtual void AdjustPositionToPlane(HC_KEY handlekey, HPoint &p, float a, float b, float c, float d, HC_KEY camerakey);
197 
202  static HC_KEY IsGeomHandle(HC_KEY key);
203 
204 
209  static bool ContainsGeomHandles(HC_KEY key);
210 
211 
217  virtual void CalculateTransformedPosition(HC_KEY handlekey, HPoint &t, HBaseView *view);
218 
223  HConstrainType GetConstraintType(HC_KEY handlekey ) { GetConstraintParameters(handlekey); return m_ConstraintType; }
224 
229  virtual void ShowHandle(HC_KEY handlekey, float sf = 0.7f,HBaseView *view = 0);
230 
235  virtual void ResetHandle(HC_KEY handlekey, float scale = 0.5f, HBaseView *view = 0);
236 
243  virtual void Scale(HC_KEY handlekey, float scalex, float scaley, float scalez);
244 
248  virtual void TurnOff(HC_KEY handlekey);
249 
250 
255  virtual HPoint * GetRotationAxis(HC_KEY handlekey) { GetConstraintParameters(handlekey); return m_rpoint; }
256 
260  static void ClearAllHandles(HBaseView *view);
261 
267  static HC_KEY SelectHandle(HBaseView *view, HPoint pos);
268 
277  static HC_KEY SelectObject(HBaseView *view, HPoint pos, HC_KEY oldkey, bool exclude, float proximity=0.3);
278 
284  static void SetupObject(HC_KEY key, HBaseView *view, float boxzoom = 1.0f);
285 
292  static void SetupTextObject(HC_KEY key, HBaseView *view, float boxzoom = 1.0f, float scale = 1.0f);
293 
298  static void SetupCuttingPlane(HC_KEY key, HBaseView *view);
299 
312  static HC_KEY SetupManipulator(HC_KEY startkey, HBaseView *view, HPoint *mp, bool AddNonUniformScale = true, bool AddScale = true, bool AddPlane = true, bool AddAxismove = true, bool AddAxisrotate = true, bool AddViewplaneMove = true);
313 
318  static void SetupCuttingPlaneManipulator(HC_KEY startkey, HBaseView *view, HPoint *midpoint = 0, bool omit_rotate = false);
319 
324  static HC_KEY GetMMSegment(HC_KEY handlekey);
325 
330  static void GetCenterPoint(HC_KEY objectkey, HPoint &centerpoint);
336  static void SetVisibilityForAll(HC_KEY startkey, const char *visibility);
337 
338 private:
339  static void drawTriangleCallback (HIC_Rendition *rendition, HIC_DC_Point *p);
340 
341  static void FindTranslation(HC_KEY handlekey, HPoint &trans);
342  static int GetMMLevel(HC_KEY handlekey);
343 
344  HC_KEY m_GeomHandleKey;
345  HConstrainType m_ConstraintType;
346  HPoint m_rpoint[3];
347 
348 };
349 
350 #ifdef H_PACK_8
351 #pragma pack(pop)
352 #endif
353 
354 #endif
355 
356 
357 
HConstrainType GetConstraintType(HC_KEY handlekey)
Definition: HUtilityGeomHandle.h:223
Constrain to specific rotation vector.
Definition: HUtilityGeomHandle.h:41
virtual HPoint * GetRotationAxis(HC_KEY handlekey)
Definition: HUtilityGeomHandle.h:255
#define HC_KEY
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:126
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:337
Constrain to plane.
Definition: HUtilityGeomHandle.h:42
No constraint.
Definition: HUtilityGeomHandle.h:39
Constrain to on/off by click.
Definition: HUtilityGeomHandle.h:45
Constrain to Scale factor.
Definition: HUtilityGeomHandle.h:44
Constrain to ray given by two points.
Definition: HUtilityGeomHandle.h:40
The HUtilityGeomHandle class contains a set of functions which controls the creation and manipulation...
Definition: HUtilityGeomHandle.h:59
HConstrainType
Definition: HUtilityGeomHandle.h:37
Constrain to viewplane.
Definition: HUtilityGeomHandle.h:43