Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

HUtilityGeomHandle.h
Go to the documentation of this file.
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
13 #ifndef _HUTILITYGEOMHANDLE_H
14 #define _HUTILITYGEOMHANDLE_H
15 
16 #ifdef H_PACK_8
17 #pragma pack(push)
18 #pragma pack(8)
19 #endif
20 
21 #include "HTools.h"
22 #include "HUtilityAnnotation.h"
23 #include "hic_types.h"
24 
25 class HPoint;
26 class HBaseView;
27 
28 
33 {
41 };
42 
43 
44 
46 
54 class MVO_API HUtilityGeomHandle
55 {
56 public:
57 
58 
59  virtual ~HUtilityGeomHandle() { };
60 
62  static void RegisterCallbacks();
63 
70  virtual HC_KEY Insert(HPoint position, bool edges = false, int level = 4);
71 
75  virtual void SetupGeomHandleSegment(bool edges);
76 
84  virtual void ConstrainToPlane(HC_KEY handlekey, HPoint p1, HPoint p2, HPoint p3,HBaseView *view = 0);
85 
89  virtual void ConstrainToViewplane(HC_KEY handlekey,HBaseView *view = 0);
90 
96  virtual void ConstrainToRay(HC_KEY handlekey, HPoint p1, HPoint p2, HBaseView *view = 0);
97 
103  virtual void ConstrainToRotationVector(HC_KEY handlekey, HPoint p1, HPoint p2,HBaseView *view = 0);
104 
110  virtual void ConstrainToScale(HC_KEY handlekey, HPoint p1, HPoint p2,HBaseView *view = 0);
111 
115  virtual void ConstrainToOnOff(HC_KEY handlekey,HBaseView *view = 0);
116 
123  virtual void Move(HC_KEY handlekey, HPoint newposition, HC_KEY camerakey, HBaseView *view = 0);
124 
125 
130  virtual void ShowBasePosition(HC_KEY handlekey, HPoint &bp);
131 
136  virtual void GetConstraintParameters(HC_KEY handlekey);
137 
142  void Rotate(HC_KEY handlekey, float rotangle);
143 
150  virtual float CalculatePlaneZ(HC_KEY handlekey, HPoint point);
151 
152 
159  virtual void AdjustPositionToRay(HC_KEY handlekey, HPoint &C, HPoint A, HPoint B);
160 
170  virtual void CalculatePositionOnPlane(HC_KEY handlekey, HPoint &p, float a, float b, float c, float d);
171 
172 
179  void AdjustPointToRay(HC_KEY geomhandlekey, HPoint &p, HC_KEY camerasegment, HBaseView *view);
180 
191  virtual void AdjustPositionToPlane(HC_KEY handlekey, HPoint &p, float a, float b, float c, float d, HC_KEY camerakey);
192 
197  static HC_KEY IsGeomHandle(HC_KEY key);
198 
199 
204  static bool ContainsGeomHandles(HC_KEY key);
205 
206 
212  virtual void CalculateTransformedPosition(HC_KEY handlekey, HPoint &t, HBaseView *view);
213 
218  HConstrainType GetConstraintType(HC_KEY handlekey ) { GetConstraintParameters(handlekey); return m_ConstraintType; }
219 
224  virtual void ShowHandle(HC_KEY handlekey, float sf = 0.7f,HBaseView *view = 0);
225 
230  virtual void ResetHandle(HC_KEY handlekey, float scale = 0.5f, HBaseView *view = 0);
231 
238  virtual void Scale(HC_KEY handlekey, float scalex, float scaley, float scalez);
239 
243  virtual void TurnOff(HC_KEY handlekey);
244 
245 
250  virtual HPoint * GetRotationAxis(HC_KEY handlekey) { GetConstraintParameters(handlekey); return m_rpoint; }
251 
255  static void ClearAllHandles(HBaseView *view);
256 
262  static HC_KEY SelectHandle(HBaseView *view, HPoint pos);
263 
272  static HC_KEY SelectObject(HBaseView *view, HPoint pos, HC_KEY oldkey, bool exclude, float proximity=0.3);
273 
279  static void SetupObject(HC_KEY key, HBaseView *view, float boxzoom = 1.0f);
280 
287  static void SetupTextObject(HC_KEY key, HBaseView *view, float boxzoom = 1.0f, float scale = 1.0f);
288 
293  static void SetupCuttingPlane(HC_KEY key, HBaseView *view);
294 
307  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);
308 
313  static void SetupCuttingPlaneManipulator(HC_KEY startkey, HBaseView *view, HPoint *midpoint = 0, bool omit_rotate = false);
314 
319  static HC_KEY GetMMSegment(HC_KEY handlekey);
320 
325  static void GetCenterPoint(HC_KEY objectkey, HPoint &centerpoint);
331  static void SetVisibilityForAll(HC_KEY startkey, const char *visibility);
332 
333 private:
334  static void drawTriangleCallback (HIC_Rendition *rendition, HIC_DC_Point *p);
335 
336  static void FindTranslation(HC_KEY handlekey, HPoint &trans);
337  static int GetMMLevel(HC_KEY handlekey);
338 
339  HC_KEY m_GeomHandleKey;
340  HConstrainType m_ConstraintType;
341  HPoint m_rpoint[3];
342 
343 };
344 
345 #ifdef H_PACK_8
346 #pragma pack(pop)
347 #endif
348 
349 #endif
350 
351 
352 
HConstrainType GetConstraintType(HC_KEY handlekey)
Definition: HUtilityGeomHandle.h:218
Constrain to specific rotation vector.
Definition: HUtilityGeomHandle.h:36
virtual HPoint * GetRotationAxis(HC_KEY handlekey)
Definition: HUtilityGeomHandle.h:250
#define HC_KEY
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:121
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
Constrain to plane.
Definition: HUtilityGeomHandle.h:37
No constraint.
Definition: HUtilityGeomHandle.h:34
Constrain to on/off by click.
Definition: HUtilityGeomHandle.h:40
Constrain to Scale factor.
Definition: HUtilityGeomHandle.h:39
Constrain to ray given by two points.
Definition: HUtilityGeomHandle.h:35
The HUtilityGeomHandle class contains a set of functions which controls the creation and manipulation...
Definition: HUtilityGeomHandle.h:54
HConstrainType
Definition: HUtilityGeomHandle.h:32
Constrain to viewplane.
Definition: HUtilityGeomHandle.h:38