sprk.h
1 // Copyright (c) 1998-2014 by 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 
10 #ifndef SPRK_H
11 #define SPRK_H
12 
13 #include "hps.h"
14 
15 #include <list>
16 #include <stack>
17 #include <memory>
18 #include <map>
19 
20 #ifdef _MSC_VER
21 # pragma warning(disable: 4251) //Not an issue as long as debug and release libraries aren't mixed
22 #ifndef STATIC_APP
23 # ifdef SPROCKETS
24 # define SPRK_API __declspec (dllexport)
25 # else
26 # define SPRK_API __declspec (dllimport)
27 # endif
28 #endif
29 #else
30 # include <stddef.h>
31 # if defined(LINUX_SYSTEM) && defined(SPROCKETS)
32 # ifndef STATIC_APP
33 # define SPRK_API __attribute__ ((visibility ("default")))
34 # endif
35 # endif
36 #endif
37 
38 #ifndef SPRK_API
39 # define SPRK_API
40 #endif
41 namespace SPRKI
42 {
43  class X;
44 };
45 
46 namespace HPS
47 {
48 
49 class Factory;
50 class Canvas;
51 class Layout;
52 class View;
53 class Model;
54 class Operator;
55 class OperatorControl;
56 class NavigationCubeControl;
57 class AxisTriadControl;
58 class Component;
59 class ComponentPath;
60 class ComponentHighlightEvent;
61 class Filter;
62 class Capture;
63 class CADModel;
64 class Metadata;
65 
66 
67 
68 
69 class SPRK_API Sprocket : public HPS::Object
70 {
71 public:
72  Sprocket() {}
73  Sprocket(Sprocket && in_that) : HPS::Object(std::move(in_that)) {}
74 
75  virtual ~Sprocket() {}
76 
77  enum class UpdateType
78  {
79  Synchronous,
80  Asynchronous
81  };
82 };
83 
84 typedef std::shared_ptr<Operator> OperatorPtr;
85 
86 typedef std::vector<OperatorPtr, Allocator<OperatorPtr> > OperatorPtrArray;
87 
88 typedef std::vector<Canvas, Allocator<Canvas> > CanvasArray;
89 typedef std::vector<Layout, Allocator<Layout> > LayoutArray;
90 typedef std::vector<View, Allocator<View> > ViewArray;
91 typedef std::vector<Model, Allocator<Model> > ModelArray;
92 
93 typedef std::vector<Component, Allocator<Component> > ComponentArray;
94 typedef std::vector<Metadata, Allocator<Metadata> > MetadataArray;
95 typedef std::vector<Filter, Allocator<Filter> > FilterArray;
96 typedef std::vector<Capture, Allocator<Capture> > CaptureArray;
97 typedef std::vector<CADModel, Allocator<CADModel> > CADModelArray;
98 typedef std::vector<ReferenceKeyArray, Allocator<ReferenceKeyArray>> ReferenceKeyArrayArray;
99 typedef std::vector<ComponentPath, Allocator<ComponentPath>> ComponentPathArray;
100 
101 
105 class SPRK_API Canvas : public Sprocket
106 {
107 public:
108  Canvas();
109  Canvas(Canvas const & that);
110  ~Canvas();
111 
112  HPS::Type ObjectType() const { return HPS::Type::Canvas; }
113 
115  void Delete();
116 
117  Canvas & operator=(Canvas const & in_that);
118  void Assign(Canvas const & in_that);
119 
120  bool Equals(Canvas const & in_that) const;
121  bool operator!= (Canvas const & in_that) const;
122  bool operator== (Canvas const & in_that) const;
123 
125  UTF8 GetName() const;
126 
130  void AttachLayout(Layout const & in_layout);
131 
135  void AttachViewAsLayout(View const & in_view);
136 
138  void DetachLayout();
139 
141  Layout GetAttachedLayout() const;
142 
144  IncludeKey GetAttachedLayoutIncludeLink() const;
145 
147  View GetFrontView() const;
148 
149  WindowKey const GetWindowKey() const;
150 
153  WindowKey GetWindowKey();
154 
155  PortfolioKey const GetPortfolioKey() const;
156 
158  PortfolioKey GetPortfolioKey();
159 
161  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
162 
165  UpdateNotifier UpdateWithNotifier() const;
166 
170  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit = -1.) const;
171 
176  UpdateNotifier UpdateWithNotifier(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit = -1.) const;
177 
181  void SetFrameRate(float in_frame_rate=20);
182 
186  float GetFrameRate() const;
187 };
188 
189 class SPRK_API Rendering
190 {
191 public:
194  enum class Mode
195  {
196  Gouraud,
197  GouraudWithLines,
198  Flat,
199  FlatWithLines,
200  Phong,
201  PhongWithLines,
202  HiddenLine,
203  FastHiddenLine,
204  Wireframe,
205  Default = Phong
206  };
207 
208 private:
209  Rendering() {}
210 };
211 
212 class SPRK_API SprocketControl : public Sprocket
213 {
214 public:
215  HPS::Type ObjectType() const {return HPS::Type::SprocketControl;}
216 
217 protected:
218  SprocketControl() {}
219 
223  SprocketControl(SprocketControl && in_that) : Sprocket(std::move(in_that)) {}
224 
229  {
230  this->Object::operator=(std::move(in_that));
231  return *this;
232  }
233 };
234 
238 class SPRK_API View : public Sprocket
239 {
240 public:
241  View();
242  View(View const & that);
243  explicit View(SprocketControl const & in_ctrl);
244  ~View();
245 
246  HPS::Type ObjectType() const { return HPS::Type::View; }
247 
249  void Delete();
250 
251  View & operator=(View const & in_that);
252  void Assign(View const & in_that);
253 
254  bool Equals(View const & in_that) const;
255  bool operator!= (View const & in_that) const;
256  bool operator== (View const & in_that) const;
257 
259  UTF8 GetName() const;
260 
261 
263  HPS::View & ComputeFitWorldCamera(HPS::CameraKit & out_camera);
264 
267  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, HPS::CameraKit & out_camera);
268 
269 
272  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, HPS::CameraKit & out_camera);
273 
278  HPS::View & ComputeFitWorldCamera(SegmentKey const & in_segment, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
279 
280 
285  HPS::View & ComputeFitWorldCamera(BoundingKit const & in_bounding, MatrixKit const & in_transform, HPS::CameraKit & out_camera);
286 
287 
289  HPS::View & FitWorld();
290 
293  HPS::View & FitWorld(SegmentKey const & in_segment);
294 
295 
298  HPS::View & FitWorld(BoundingKit const & in_bounding);
299 
304  HPS::View & FitWorld(SegmentKey const & in_segment, MatrixKit const & in_transform);
305 
306 
311  HPS::View & FitWorld(BoundingKit const & in_bounding, MatrixKit const & in_transform);
312 
317  void AttachModel(Model const & in_model);
318 
320  void DetachModel();
321 
323  Model GetAttachedModel() const;
324 
326  IncludeKey GetAttachedModelIncludeLink() const;
327 
331  void SetRenderingMode(Rendering::Mode in_mode);
332 
335  Rendering::Mode GetRenderingMode() const;
336 
338  OperatorPtrArray GetOperators() const;
339 
342  void SetOperators(OperatorPtrArray & in_operators);
343 
347  void SetOperators(size_t in_count, OperatorPtr in_operators []);
348 
351  void SetOperator(OperatorPtr const & in_operator);
352 
355  void SetOperator(Operator * in_operator);
356 
358  OperatorControl GetOperatorControl();
359  OperatorControl const GetOperatorControl() const;
360 
362  NavigationCubeControl GetNavigationCubeControl();
363  NavigationCubeControl const GetNavigationCubeControl() const;
364 
366  AxisTriadControl GetAxisTriadControl();
367  AxisTriadControl const GetAxisTriadControl() const;
368 
371  SegmentKey GetSegmentKey();
372  SegmentKey const GetSegmentKey() const;
373 
376  SegmentKey GetModelOverrideSegmentKey();
377  SegmentKey const GetModelOverrideSegmentKey() const;
378 
379 
380  PortfolioKey const GetPortfolioKey() const;
381 
383  PortfolioKey GetPortfolioKey();
384 
389  void SetSimpleShadow(bool in_state, float in_percent_offset = 5.0f);
390 
391  /* Returns the status of the simple shadows */
392  bool GetSimpleShadow();
393 
398  void SetSimpleReflection(bool in_state, float in_percent_offset = 5.0f);
399 
400  /* Returns the status of the simple reflection */
401  bool GetSimpleReflection();
402 
404  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
405 
409  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
410 
411  /* Smoothly moves the camera from the current position to the one specified by the user.
412  \param in_camera_kit a camera kit describing the destination camera
413  \param in_duration the duration of the animation, specified in seconds. Defaults to 0.5 seconds. */
414  void SmoothTransition(HPS::CameraKit const & in_camera_kit, HPS::Time in_duration = 0.5);
415 
416  static UTF8 GetHideStyleName();
417  static UTF8 GetShowStyleName();
418 
420  KeyArray const GetNavigationKeys();
421 
423  LayoutArray GetOwningLayouts();
424  LayoutArray const GetOwningLayouts() const;
425 };
426 
430 class SPRK_API Model : public Sprocket
431 {
432 public:
433  Model();
434  Model(Model const & that);
435  ~Model();
436 
437  HPS::Type ObjectType() const { return HPS::Type::Model; }
438 
440  void Delete();
441 
442  Model & operator=(Model const & in_that);
443  void Assign(Model const & in_that);
444 
445  bool Equals(Model const & in_that) const;
446  bool operator!= (Model const & in_that) const;
447  bool operator== (Model const & in_that) const;
448 
450  UTF8 GetName() const;
451 
454  SegmentKey GetSegmentKey();
455  SegmentKey const GetSegmentKey() const;
456 
458  SegmentKey GetLibraryKey();
459  SegmentKey const GetLibraryKey() const;
460 
462  PortfolioKey GetPortfolioKey();
463  PortfolioKey const GetPortfolioKey() const;
464 
466  HPS::Vector GetUpVector();
467  HPS::Vector const GetUpVector() const;
468 
470  HPS::Vector GetFrontVector();
471  HPS::Vector const GetFrontVector() const;
472 
474  HPS::ViewArray GetOwningViews();
475  HPS::ViewArray const GetOwningViews() const;
476 
480  void SetOrientation(HPS::Vector & in_up_vector, HPS::Vector & in_front_vector);
481 
483  bool ShowOrientation(HPS::Vector & out_up_vector, HPS::Vector & out_front_vector);
484 
486  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
487 
491  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
492 };
493 
497 class SPRK_API Layout : public Sprocket
498 {
499 public:
500  Layout();
501  Layout(Layout const & that);
502  ~Layout();
503 
504  HPS::Type ObjectType() const { return HPS::Type::Layout; }
505 
507  void Delete();
508 
509  Layout & operator=(Layout const & in_that);
510  void Assign(Layout const & in_that);
511 
512  bool Equals(Layout const & in_that) const;
513  bool operator!= (Layout const & in_that) const;
514  bool operator== (Layout const & in_that) const;
515 
517  UTF8 GetName() const;
518 
519  /* Returns the number of Layers currently associated with this Layout */
520  size_t GetLayerCount() const;
521 
525  void AttachViewFront(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
529  void AttachViewBack(View const & in_view, HPS::Rectangle const & in_position = HPS::Rectangle(-1.0f, 1.0f, -1.0f, 1.0f));
530 
533  void DetachLayer(size_t in_layer);
534 
537  void DetachView(View const & in_view); // everywhere it occurs
538 
541  void BringToFront(size_t in_layer);
542 
546  void ReassignLayer(size_t in_layer, HPS::View in_view);
547 
551  void RepositionLayer(size_t in_layer, HPS::Rectangle const & in_position);
552 
554  View GetFrontView() const;
555 
559  View GetAttachedView(size_t in_layer = 0) const;
560 
564  Rectangle GetPosition(size_t in_layer) const;
565 
567  IncludeKey GetAttachedViewIncludeLink(size_t in_layer) const;
568 
570  SegmentKey GetLayerSegmentKey(size_t in_layer) const;
571 
572  /* Returns the position within the layer list of the top layer at a specified position
573  * \param in_point A point in Window coordinates.
574  * \return The position within the layer list of the top layer at position in_point. */
575  size_t GetLayerAt(HPS::WindowPoint const & in_point) const;
576 
577  /* Returns whether a layer is present at the specified position.
578  * \param in_point A point in Window coordinates.
579  * \return <span class='code'>true</span> if a layer is present at in_point, <span class='code'>false</span> otherwise. */
580  bool ShowLayerAt(HPS::WindowPoint const & in_point) const;
581 
584  SegmentKey GetSegmentKey();
585  SegmentKey const GetSegmentKey() const;
586 
588  CanvasArray GetOwningCanvases();
589  CanvasArray const GetOwningCanvases() const;
590 
592  void Update(HPS::Sprocket::UpdateType in_update_type = Sprocket::UpdateType::Asynchronous) const;
593 
597  void Update(HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const;
598 };
599 
600 class SPRK_API CanvasDeletedEvent : public Event
601 {
602 public:
605  {
606  channel = GetClassID();
607  consumable = false;
608  }
609 
610  CanvasDeletedEvent(Canvas const & in_canvas)
611  : Event(), canvas(in_canvas)
612  {
613  channel = GetClassID();
614  consumable = false;
615  }
616 
619  CanvasDeletedEvent(Event const & in_event) : Event(in_event)
620  {
621  if (in_event.GetChannel() == Object::ClassID<CanvasDeletedEvent>())
622  {
623  auto that = static_cast<CanvasDeletedEvent const &>(in_event);
624  canvas = that.canvas;
625  }
626  else
627  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
628  }
629 
631 
634  Event * Clone() const
635  {
636  CanvasDeletedEvent * new_event = new CanvasDeletedEvent(*this);
637  return new_event;
638  }
639 
640  Canvas canvas;
641 };
642 
643 class SPRK_API LayoutDetachedEvent : public Event
644 {
645 public:
648  {
649  channel = GetClassID();
650  consumable = false;
651  }
652 
653  LayoutDetachedEvent(Canvas const & in_canvas, Layout const & in_layout)
654  : Event(), canvas(in_canvas), layout(in_layout)
655  {
656  channel = GetClassID();
657  consumable = false;
658  }
659 
662  LayoutDetachedEvent(Event const & in_event) : Event(in_event)
663  {
664  if (in_event.GetChannel() == Object::ClassID<LayoutDetachedEvent>())
665  {
666  auto that = static_cast<LayoutDetachedEvent const &>(in_event);
667  canvas = that.canvas;
668  layout = that.layout;
669  }
670  else
671  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
672  }
673 
675 
678  Event * Clone() const
679  {
680  LayoutDetachedEvent * new_event = new LayoutDetachedEvent(*this);
681  return new_event;
682  }
683 
684  Canvas canvas;
685  Layout layout;
686 };
687 
688 class SPRK_API LayoutDeletedEvent : public Event
689 {
690 public:
693  {
694  channel = GetClassID();
695  consumable = false;
696  }
697 
698  LayoutDeletedEvent(Layout const & in_layout)
699  : Event(), layout(in_layout)
700  {
701  channel = GetClassID();
702  consumable = false;
703  }
704 
707  LayoutDeletedEvent(Event const & in_event) : Event(in_event)
708  {
709  if (in_event.GetChannel() == Object::ClassID<LayoutDeletedEvent>())
710  {
711  auto that = static_cast<LayoutDeletedEvent const &>(in_event);
712  layout = that.layout;
713  }
714  else
715  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
716  }
717 
719 
722  Event * Clone() const
723  {
724  LayoutDeletedEvent * new_event = new LayoutDeletedEvent(*this);
725  return new_event;
726  }
727 
728  Layout layout;
729 };
730 
731 class SPRK_API ViewDetachedEvent : public Event
732 {
733 public:
734  enum class Action
735  {
736  None = 0,
737  SpecificLayer,
738  AllLayers,
739  };
740 
742  ViewDetachedEvent() : Event(), action(Action::None), layer(0)
743  {
744  channel = GetClassID();
745  consumable = false;
746  }
747 
748  ViewDetachedEvent(Layout const & in_layout, size_t in_layer, View const & in_view)
749  : Event(), layout(in_layout), action(Action::SpecificLayer), layer(in_layer), view(in_view)
750  {
751  channel = GetClassID();
752  consumable = false;
753  }
754 
755  ViewDetachedEvent(Layout const & in_layout, View const & in_view)
756  : Event(), layout(in_layout), action(Action::AllLayers), layer(std::numeric_limits<size_t>::max()), view(in_view)
757  {
758  channel = GetClassID();
759  consumable = false;
760  }
761 
764  ViewDetachedEvent(Event const & in_event) : Event(in_event)
765  {
766  if (in_event.GetChannel() == Object::ClassID<ViewDetachedEvent>())
767  {
768  auto that = static_cast<ViewDetachedEvent const &>(in_event);
769  layout = that.layout;
770  action = that.action;
771  layer = that.layer;
772  view = that.view;
773  }
774  else
775  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
776  }
777 
779 
782  Event * Clone() const
783  {
784  ViewDetachedEvent * new_event = new ViewDetachedEvent(*this);
785  return new_event;
786  }
787 
788  Layout layout;
789  Action action;
790  size_t layer;
791  View view;
792 };
793 
794 class SPRK_API ViewDeletedEvent : public Event
795 {
796 public:
799  {
800  channel = GetClassID();
801  consumable = false;
802  }
803 
804  ViewDeletedEvent(View const & in_view)
805  : Event(), view(in_view)
806  {
807  channel = GetClassID();
808  consumable = false;
809  }
810 
813  ViewDeletedEvent(Event const & in_event) : Event(in_event)
814  {
815  if (in_event.GetChannel() == Object::ClassID<ViewDeletedEvent>())
816  {
817  auto that = static_cast<ViewDeletedEvent const &>(in_event);
818  view = that.view;
819  }
820  else
821  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
822  }
823 
824  ~ViewDeletedEvent();
825 
828  Event * Clone() const
829  {
830  ViewDeletedEvent * new_event = new ViewDeletedEvent(*this);
831  return new_event;
832  }
833 
834  View view;
835 };
836 
837 class SPRK_API ModelDetachedEvent : public Event
838 {
839 public:
842  {
843  channel = GetClassID();
844  consumable = false;
845  }
846 
847  ModelDetachedEvent(View const & in_view, Model const & in_model)
848  : Event(), view(in_view), model(in_model)
849  {
850  channel = GetClassID();
851  consumable = false;
852  }
853 
856  ModelDetachedEvent(Event const & in_event) : Event(in_event)
857  {
858  if (in_event.GetChannel() == Object::ClassID<ModelDetachedEvent>())
859  {
860  auto that = static_cast<ModelDetachedEvent const &>(in_event);
861  view = that.view;
862  model = that.model;
863  }
864  else
865  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
866  }
867 
869 
872  Event * Clone() const
873  {
874  ModelDetachedEvent * new_event = new ModelDetachedEvent(*this);
875  return new_event;
876  }
877 
878  View view;
879  Model model;
880 };
881 
882 class SPRK_API ModelDeletedEvent : public Event
883 {
884 public:
887  {
888  channel = GetClassID();
889  consumable = false;
890  }
891 
892  ModelDeletedEvent(Model const & in_model)
893  : Event(), model(in_model)
894  {
895  channel = GetClassID();
896  consumable = false;
897  }
898 
901  ModelDeletedEvent(Event const & in_event) : Event(in_event)
902  {
903  if (in_event.GetChannel() == Object::ClassID<ModelDeletedEvent>())
904  {
905  auto that = static_cast<ModelDeletedEvent const &>(in_event);
906  model = that.model;
907  }
908  else
909  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
910  }
911 
913 
916  Event * Clone() const
917  {
918  ModelDeletedEvent * new_event = new ModelDeletedEvent(*this);
919  return new_event;
920  }
921 
922  Model model;
923 };
924 
925 /* The SprocketPath class is a utility class which can be used to automatically obtain a KeyPath
926  * from the Model to the Canvas. */
927 class SPRK_API SprocketPath : public Sprocket
928 {
929 public:
930  SprocketPath();
931  SprocketPath(Model const & in_model, View const & in_view, Layout const & in_layout, Canvas const & in_canvas);
932  SprocketPath(Canvas const & in_canvas, Layout const & in_layout, View const & in_view, Model const & in_model);
933  SprocketPath(Canvas const & in_canvas, size_t in_layer = 0);
934  SprocketPath(SprocketPath const & that);
935  ~SprocketPath();
936 
937  HPS::Type ObjectType() const { return HPS::Type::SprocketPath; }
938 
939  SprocketPath & operator=(SprocketPath const & in_that);
940  void Set(SprocketPath const & in_that);
941 
942  bool Equals(SprocketPath const & in_that) const;
943  bool operator!= (SprocketPath const & in_that) const;
944  bool operator== (SprocketPath const & in_that) const;
945 
947  Canvas GetCanvas() const;
948 
950  Layout GetLayout() const;
951 
953  View GetView() const;
954 
956  Model GetModel() const;
957 
962  KeyPath GetKeyPath() const;
963 };
964 
965 
968 class SPRK_API Operator : public Sprocket
969 {
970 public:
971  Operator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
972  Operator(Operator const & in_that);
973 
974  virtual ~Operator();
975 
976  HPS::Type ObjectType() const { return HPS::Type::Operator; }
977 
978  virtual Operator & operator= (Operator const & in_that);
979 
980  /* Assigns the parameter in_that to this operator, resulting in a clone. */
981  virtual void Assign(Operator const & in_that);
982 
983  /* Tests this operator for equality against the parameter <span class=code>in_that</span>. Same as Operator::operator== */
984  virtual bool Equals(Operator const & in_that) const;
985 
986  /* Tests this operator for non-equality against the parameter <span class=code>in_that</span>. */
987  virtual bool operator!= (Operator const & in_that) const;
988 
989  /* Tests this operator for equality against the parameter <span class=code>in_that</span>. Same as Operator::Equals. */
990  virtual bool operator== (Operator const & in_that) const;
991 
993  void DetachView();
994 
996  View GetAttachedView() const;
997 
999  virtual UTF8 GetName() const { return "Operator"; }
1000 
1004  virtual bool OnMouseDown(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1005 
1009  virtual bool OnMouseUp(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1010 
1014  virtual bool OnMouseMove(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1015 
1019  virtual bool OnMouseWheel(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1020 
1024  virtual bool OnMouseEnter(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1025 
1029  virtual bool OnMouseLeave(MouseState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1030 
1034  virtual bool OnTouchDown(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1035 
1039  virtual bool OnTouchUp(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1040 
1044  virtual bool OnTouchMove(TouchState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1045 
1049  virtual bool OnKeyDown(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1050 
1054  virtual bool OnKeyUp(KeyboardState const & in_state) { HPS_UNREFERENCED(in_state); return false; }
1055 
1059  virtual bool OnTimerTick(HPS::TimerTickEvent const & in_event) { HPS_UNREFERENCED(in_event); return false; }
1060 
1062  virtual void OnViewAttached() { return; }
1063 
1065  virtual void OnViewDetached() { return; }
1066 
1069  virtual void OnModelAttached() { return; }
1070 
1073  virtual void OnModelDetached() { return; }
1074 
1076  void SetMouseTrigger(MouseButtons in_buttons) { mouse_trigger = in_buttons; }
1077 
1080  MouseButtons GetMouseTrigger() const { return mouse_trigger; }
1081 
1085  void SetModifierTrigger(ModifierKeys in_modifiers) { modifier_trigger = in_modifiers; }
1086 
1088  ModifierKeys GetModifierTrigger() const { return modifier_trigger; }
1089 
1091  virtual bool IsMouseTriggered(MouseState const & in_state) { return in_state.HasAll(mouse_trigger, modifier_trigger); }
1092 
1093  enum class Priority
1094  {
1095  Low,
1096  Normal,
1097  High
1098  };
1099 
1100 protected:
1101 
1102  HPS::MouseButtons mouse_trigger;
1103  HPS::ModifierKeys modifier_trigger;
1104 };
1105 
1108 class SPRK_API OperatorControl : public SprocketControl
1109 {
1110 public:
1112  explicit OperatorControl(View const & in_view);
1113 
1115  OperatorControl(OperatorControl const & in_that);
1116 
1120  OperatorControl(OperatorControl && in_that);
1121 
1125  OperatorControl & operator=(OperatorControl && in_that);
1126 
1128  ~OperatorControl();
1129 
1130  HPS::Type ObjectType() const {return HPS::Type::OperatorControl;};
1131 
1133  OperatorControl & operator=(OperatorControl const & in_that);
1134 
1135 
1137  size_t GetCount();
1138 
1141  size_t GetCount(Operator::Priority in_priority);
1142 
1143 
1149  OperatorControl & Push(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1150 
1156  OperatorControl & Push(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1157 
1161  bool Pop(Operator::Priority in_priority = Operator::Priority::Normal);
1162 
1167  bool Pop(OperatorPtr & out_operator);
1168 
1174  bool Pop(Operator::Priority in_priority, OperatorPtr & out_operator);
1175 
1176 
1182  OperatorControl & Set(OperatorPtr const & in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1183 
1189  OperatorControl & Set(Operator * in_operator, Operator::Priority in_priority = Operator::Priority::Normal);
1190 
1196  OperatorControl & Set(OperatorPtrArray & in_operators, Operator::Priority in_priority = Operator::Priority::Normal);
1197 
1204  OperatorControl & Set(size_t in_count, OperatorPtr in_operators [], Operator::Priority in_priority = Operator::Priority::Normal);
1205 
1206 
1210  OperatorControl & UnsetTop(Operator::Priority in_priority = Operator::Priority::Normal);
1211 
1215  OperatorControl & UnsetEverything(Operator::Priority in_priority);
1216 
1219  OperatorControl & UnsetEverything();
1220 
1221 
1225  bool ShowTop(OperatorPtr & out_operator) const;
1226 
1231  bool ShowTop(Operator::Priority in_priority, OperatorPtr & out_operator) const;
1232 
1236  bool Show(OperatorPtrArray & out_operators) const;
1237 
1242  bool Show(Operator::Priority in_priority, OperatorPtrArray & out_operators) const;
1243 
1244 private:
1246  OperatorControl() {}
1247 };
1248 
1252 {
1253 public:
1254 
1255  enum class Location
1256  {
1257  TopRight,
1258  TopLeft,
1259  BottomRight,
1260  BottomLeft,
1261  Custom,
1262  };
1263 
1265  explicit NavigationCubeControl(View const & in_view);
1266 
1269 
1274 
1278  NavigationCubeControl & operator=(NavigationCubeControl && in_that);
1279 
1282 
1283  HPS::Type ObjectType() const {return HPS::Type::NavigationCubeControl;};
1284 
1286  NavigationCubeControl & operator=(NavigationCubeControl const & in_that);
1287 
1294  NavigationCubeControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1295 
1298  Location GetLocation() const;
1299 
1303  NavigationCubeControl & SetPosition(HPS::Rectangle const & in_rectangle);
1304 
1307  HPS::Rectangle GetPosition() const;
1308 
1313  NavigationCubeControl & SetVisibility(bool in_visibility);
1314 
1317  bool GetVisibility() const;
1318 
1322  NavigationCubeControl & SetTextVisibility(bool in_text_visibility);
1323 
1326  bool GetTextVisibility() const;
1327 
1342  NavigationCubeControl & SetMaterialPalette(const char * in_material_palette);
1343 
1346  HPS::UTF8 GetMaterialPalette() const;
1347 
1355  NavigationCubeControl & SetInteractivity(bool in_interactivity);
1356 
1357 
1360  bool GetInteractivity() const;
1361 
1366  NavigationCubeControl & SetSize(float in_size);
1367 
1370  float GetSize() const;
1371 
1374  HPS::SegmentKey GetSegmentKey() const;
1375 
1376 private:
1379 
1381  HPS::SegmentKey GetNavigationCubeSegment() const;
1382 };
1383 
1386 class SPRK_API AxisTriadControl : public SprocketControl
1387 {
1388 public:
1389 
1390  enum class Location
1391  {
1392  TopRight,
1393  TopLeft,
1394  BottomRight,
1395  BottomLeft,
1396  Custom,
1397  };
1398 
1400  explicit AxisTriadControl(View const & in_view);
1401 
1403  AxisTriadControl(AxisTriadControl const & in_that);
1404 
1408  AxisTriadControl(AxisTriadControl && in_that);
1409 
1413  AxisTriadControl & operator=(AxisTriadControl && in_that);
1414 
1416  ~AxisTriadControl();
1417 
1418  HPS::Type ObjectType() const {return HPS::Type::AxisTriadControl;};
1419 
1421  AxisTriadControl & operator=(AxisTriadControl const & in_that);
1422 
1429  HPS::AxisTriadControl & SetLocation(Location in_location, HPS::Rectangle const & in_rectangle = HPS::Rectangle());
1430 
1433  Location GetLocation() const;
1434 
1438  AxisTriadControl & SetPosition(HPS::Rectangle const & in_rectangle);
1439 
1442  HPS::Rectangle GetPosition() const;
1443 
1448  HPS::AxisTriadControl & SetVisibility(bool in_visibility);
1449 
1452  bool GetVisibility() const;
1453 
1457  HPS::AxisTriadControl & SetTextVisibility(bool in_text_visibility);
1458 
1461  bool GetTextVisibility() const;
1462 
1471  HPS::AxisTriadControl & SetMaterialPalette(const char * in_material_palette);
1472 
1475  HPS::UTF8 GetMaterialPalette() const;
1476 
1483  HPS::AxisTriadControl & SetInteractivity(bool in_interactivity);
1484 
1487  bool GetInteractivity() const;
1488 
1493  AxisTriadControl & SetSize(float in_size);
1494 
1497  float GetSize() const;
1498 
1501  HPS::SegmentKey GetSegmentKey() const;
1502 
1503 private:
1505  AxisTriadControl(){};
1506 
1508  HPS::SegmentKey GetAxisTriadSegment() const;
1509 };
1510 
1512 class SPRK_API Component : public Sprocket
1513 {
1514 public:
1517  enum class ComponentType : uint32_t
1518  {
1519  None = 0x00000000,
1520  GenericMask = 0xfffff000,
1521 
1522  ExchangeComponentMask = 0x00001000,
1523  ExchangeModelFile = 0x00001001,
1524  ExchangeProductOccurrence = 0x00001002,
1525  ExchangePartDefinition = 0x00001003,
1526 
1527  ExchangeView = 0x00001004,
1528  ExchangeFilter = 0x00001005,
1529 
1530  ExchangeRepresentationItemMask = 0x00003000,
1531  ExchangeRIBRepModel = 0x00003001,
1532  ExchangeRICurve = 0x00003002,
1533  ExchangeRIDirection = 0x00003003,
1534  ExchangeRIPlane = 0x00003004,
1535  ExchangeRIPointSet = 0x00003005,
1536  ExchangeRIPolyBRepModel = 0x00003006,
1537  ExchangeRIPolyWire = 0x00003007,
1538  ExchangeRISet = 0x00003008,
1539  ExchangeRICoordinateSystem = 0x00003009,
1540 
1541  ExchangeTopologyMask = 0x00005000,
1542  ExchangeTopoBody = 0x00005001,
1543  ExchangeTopoConnex = 0x00005002,
1544  ExchangeTopoShell = 0x00005003,
1545  ExchangeTopoFace = 0x00005004,
1546  ExchangeTopoLoop = 0x00005005,
1547  ExchangeTopoCoEdge = 0x00005006,
1548  ExchangeTopoEdge = 0x00005007,
1549  ExchangeTopoVertex = 0x00005008,
1550  ExchangeTopoSingleWireBody = 0x00005009,
1551  ExchangeTopoWireEdge = 0x0000500a,
1552 
1553  ExchangeDrawingMask = 0x00006000,
1554  ExchangeDrawingModel = 0x00006001,
1555  ExchangeDrawingView = 0x00006002,
1556  ExchangeDrawingSheet = 0x00006003,
1557  ExchangeBasicDrawingBlock = 0x00006004,
1558  ExchangeOperatorDrawingBlock = 0x00006005,
1559 
1560  ExchangePMIMask = 0x00009000,
1561  ExchangePMI = ExchangePMIMask,
1562  ExchangePMIText = 0x00009100,
1563  ExchangePMIRichText = 0x00009200,
1564  ExchangePMIRoughness = 0x00009300,
1565  ExchangePMIGDT = 0x00009400,
1566  ExchangePMIDatum = 0x00009500,
1567  ExchangePMILineWelding = 0x00009600,
1568  ExchangePMISpotWelding = 0x00009700,
1569  ExchangePMIDimension = 0x00009800,
1570  ExchangePMIBalloon = 0x00009900,
1571  ExchangePMICoordinate = 0x00009a00,
1572  ExchangePMIFastener = 0x00009b00,
1573  ExchangePMILocator = 0x00009c00,
1574  ExchangePMIMeasurementPoint = 0x00009d00,
1575 
1576 
1577  ParasolidComponentMask = 0x00010000,
1578 
1579  ParasolidModelFile = 0x00010001,
1580  ParasolidAssembly = 0x00010002,
1581 
1582  ParasolidTopologyMask = 0x00050000,
1583  ParasolidTopoBody = 0x00050001,
1584  ParasolidTopoRegion = 0x00050002,
1585  ParasolidTopoShell = 0x00050003,
1586  ParasolidTopoFace = 0x00050004,
1587  ParasolidTopoLoop = 0x00050005,
1588  ParasolidTopoFin = 0x00050006,
1589  ParasolidTopoEdge = 0x00050007,
1590  ParasolidTopoVertex = 0x00050008,
1591 
1592 
1593  DWGComponentMask = 0x00100000,
1594  DWGModelFile = 0x00100001,
1595  DWGLayout = 0x00100002,
1596  DWGBlockTable = 0x00100003,
1597  DWGBlockTableRecord = 0x00100004,
1598  DWGEntity = 0x00100005,
1599  DWGLayerTable = 0x00100006,
1600  DWGLayer = 0x00100007,
1601  };
1602 
1603 
1605  Component();
1606 
1609  Component(Component const & in_that);
1610 
1613  Component(Component && in_that);
1614 
1616  virtual ~Component();
1617 
1618  HPS::Type ObjectType() const { return HPS::Type::Component; }
1619 
1620 
1624  Component & operator=(Component const & in_that);
1625 
1629  Component & operator=(Component && in_that);
1630 
1634  virtual void Assign(Component const & in_that);
1635 
1639  bool Equals(Component const & in_that) const;
1640 
1644  bool operator!=(Component const & in_that) const;
1645 
1649  bool operator==(Component const & in_that) const;
1650 
1651 
1654  ComponentType GetComponentType() const;
1655 
1659  bool HasComponentType(ComponentType in_mask) const;
1660 
1661 
1662 
1668  void AddKey(Key const & in_key);
1669 
1672  KeyArray GetKeys() const;
1673 
1674 
1675 
1680  void AddOwner(Component & in_owner, IncludeKey const & in_include = IncludeKey());
1681 
1685  ComponentArray GetOwners() const;
1686 
1689  ComponentArray GetSubcomponents() const;
1690 
1695  ComponentArray GetAllSubcomponents(ComponentType in_type) const;
1696 
1697 
1698 
1701  void AddReference(Component & in_reference);
1702 
1705  ComponentArray GetReferrers() const;
1706 
1710  ComponentArray GetReferences() const;
1711 
1712 
1713 
1716  MetadataArray GetAllMetadata() const;
1717 
1721  Metadata GetMetadata(char const * in_name) const;
1722 
1723 
1724 
1729  void Delete();
1730 
1731 
1739  static KeyPathArray GetKeyPath(Component const & in_component);
1740 
1750  static KeyPathArray GetKeyPath(size_t in_count, Component const in_components[]);
1751 
1760  static KeyPathArray GetKeyPath(ComponentArray const & in_components);
1761 };
1762 
1765 class SPRK_API ComponentPath : public Sprocket
1766 {
1767 public:
1769  ComponentPath();
1770 
1773  ComponentPath(ComponentArray const & in_components);
1774 
1778  ComponentPath(size_t in_count, Component const in_components[]);
1779 
1781  ComponentPath(ComponentPath const & in_that);
1782 
1786  ComponentPath(ComponentPath && in_that);
1787 
1791  ComponentPath & operator=(ComponentPath && in_that);
1792 
1794  virtual ~ComponentPath();
1795 
1796  HPS::Type ObjectType() const { return HPS::Type::ComponentPath; }
1797 
1801  ComponentPath & operator+=(Component const & in_component);
1802 
1806  ComponentPath & operator+=(ComponentPath const & in_path);
1807 
1811  ComponentPath & operator+=(ComponentArray const & in_components);
1812 
1816  ComponentPath & Append(Component const & in_component);
1817 
1821  ComponentPath & Append(ComponentPath const & in_path);
1822 
1826  ComponentPath & Append(ComponentArray const & in_components);
1827 
1831  ComponentPath & operator=(ComponentPath const & in_that);
1832 
1836  ComponentPath & operator=(ComponentArray const & in_path);
1837 
1840  void Set(ComponentPath const & in_that);
1841 
1845  bool Equals(ComponentPath const & in_that) const;
1846 
1850  bool operator!= (ComponentPath const & in_that) const;
1851 
1855  bool operator== (ComponentPath const & in_that) const;
1856 
1857 
1861  ComponentPath & SetComponents(ComponentArray const & in_components);
1862 
1867  ComponentPath & SetComponents(size_t in_count, Component const in_components[]);
1868 
1871  ComponentArray GetComponents() const;
1872 
1876  KeyPathArray GetKeyPaths() const;
1877 
1882  KeyPathArray GetKeyPaths(Canvas const & in_canvas, size_t in_layer = 0) const;
1883 
1884 
1888  void Highlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
1889 
1894  void Highlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
1895 
1899  void Unhighlight(Canvas const & in_canvas, HighlightOptionsKit const & in_options) const;
1900 
1905  void Unhighlight(Canvas const & in_canvas, size_t in_layer, HighlightOptionsKit const & in_options) const;
1906 
1907 
1911  void Hide(Canvas const & in_canvas, size_t in_layer = 0);
1912 
1916  void Show(Canvas const & in_canvas, size_t in_layer = 0);
1917 
1923  bool IsHidden(Canvas const & in_canvas, size_t in_layer = 0);
1924 
1928  void Isolate(Canvas const & in_canvas, size_t in_layer = 0);
1929 
1930  static void Isolate(HPS::ComponentPathArray & in_components_to_be_isolated, Canvas const & in_canvas, size_t in_layer = 0);
1931 };
1932 
1933 
1938 inline ComponentPath operator+(Component const & in_lhs, Component const & in_rhs)
1939 {
1940  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1941 }
1942 
1947 inline ComponentPath operator+(Component const & in_lhs, ComponentArray const & in_rhs)
1948 {
1949  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1950 }
1951 
1956 inline ComponentPath operator+(Component const & in_lhs, ComponentPath const & in_rhs)
1957 {
1958  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1959 }
1960 
1965 inline ComponentPath operator+(ComponentArray const & in_lhs, Component const & in_rhs)
1966 {
1967  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1968 }
1969 
1974 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentArray const & in_rhs)
1975 {
1976  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1977 }
1978 
1983 inline ComponentPath operator+(ComponentArray const & in_lhs, ComponentPath const & in_rhs)
1984 {
1985  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1986 }
1987 
1992 inline ComponentPath operator+(ComponentPath const & in_lhs, Component const & in_rhs)
1993 {
1994  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
1995 }
1996 
2001 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentArray const & in_rhs)
2002 {
2003  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2004 }
2005 
2010 inline ComponentPath operator+(ComponentPath const & in_lhs, ComponentPath const & in_rhs)
2011 {
2012  return HPS::ComponentPath().Append(in_lhs).Append(in_rhs);
2013 }
2014 
2015 
2017 class SPRK_API ComponentHighlightEvent : public Event
2018 {
2019 public:
2020  enum class Action
2021  {
2022  None = 0,
2023  Highlight,
2024  Unhighlight,
2025  };
2026 
2029  {
2030  channel = GetClassID();
2031  consumable = false;
2032  action = Action::None;
2033  }
2034 
2035  ComponentHighlightEvent(Action in_action,
2036  ComponentPath const & in_path = ComponentPath(),
2037  HighlightOptionsKit const & in_options = HighlightOptionsKit())
2038  : Event(), action(in_action), path(in_path), options(in_options)
2039  {
2040  channel = GetClassID();
2041  consumable = false;
2042  }
2043 
2046  ComponentHighlightEvent(Event const & in_event) : Event(in_event)
2047  {
2048  if (in_event.GetChannel() == Object::ClassID<ComponentHighlightEvent>())
2049  {
2050  auto that = static_cast<ComponentHighlightEvent const &>(in_event);
2051  action = that.action;
2052  path = that.path;
2053  options = that.options;
2054  }
2055  else
2056  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2057  }
2058 
2060 
2063  Event * Clone() const
2064  {
2065  ComponentHighlightEvent * new_event = new ComponentHighlightEvent(*this);
2066  return new_event;
2067  }
2068 
2069  Action action;
2070  ComponentPath path;
2071  HighlightOptionsKit options;
2072 };
2073 
2074 
2076 class SPRK_API Filter : public Component
2077 {
2078 public:
2080  Filter();
2081 
2085  Filter(Component const & in_that);
2086 
2089  Filter(Filter const & in_that);
2090 
2093  Filter(Filter && in_that);
2094 
2095  virtual ~Filter();
2096 
2097  HPS::Type ObjectType() const { return HPS::Type::Filter; }
2098 
2099 #ifndef _MSC_VER
2100  Filter & operator=(Filter const & in_that) = default;
2101 #endif
2102 
2106  Filter & operator=(Filter && in_that);
2107 
2108 
2111  void Activate(View const & in_view);
2112 
2115  void Deactivate(View const & in_view);
2116 };
2117 
2118 
2119 class SPRK_API FilterActivationEvent : public Event
2120 {
2121 public:
2122  enum class Action
2123  {
2124  None = 0,
2125  Activate,
2126  Deactivate,
2127  };
2128 
2131  {
2132  channel = GetClassID();
2133  consumable = false;
2134  }
2135 
2136  FilterActivationEvent(Filter in_filter, Action in_action, View in_view) : Event(), filter(in_filter), action(in_action), view(in_view)
2137  {
2138  channel = GetClassID();
2139  consumable = false;
2140  }
2141 
2144  FilterActivationEvent(Event const & in_event) : Event(in_event)
2145  {
2146  if (in_event.GetChannel() == Object::ClassID<FilterActivationEvent>())
2147  {
2148  auto that = static_cast<FilterActivationEvent const &>(in_event);
2149  filter = that.filter;
2150  action = that.action;
2151  view = that.view;
2152  }
2153  else
2154  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2155  }
2156 
2158 
2161  Event * Clone() const
2162  {
2163  FilterActivationEvent * new_event = new FilterActivationEvent(*this);
2164  return new_event;
2165  }
2166 
2167  Filter filter;
2168  Action action;
2169  View view;
2170 };
2171 
2172 
2174 class SPRK_API Capture : public Component
2175 {
2176 public:
2178  Capture();
2179 
2183  Capture(Component const & in_that);
2184 
2187  Capture(Capture const & in_that);
2188 
2191  Capture(Capture && in_that);
2192 
2193  virtual ~Capture();
2194 
2195  HPS::Type ObjectType() const { return HPS::Type::Capture; }
2196 
2197 #ifndef _MSC_VER
2198  Capture & operator=(Capture const & in_that) = default;
2199 #endif
2200 
2204  Capture & operator=(Capture && in_that);
2205 
2206 
2210  View Activate();
2211 };
2212 
2213 
2214 class SPRK_API CaptureActivationEvent : public Event
2215 {
2216 public:
2219  {
2220  channel = GetClassID();
2221  consumable = false;
2222  }
2223 
2224  CaptureActivationEvent(Capture in_capture, View in_view) : Event(), capture(in_capture), view(in_view)
2225  {
2226  channel = GetClassID();
2227  consumable = false;
2228  }
2229 
2232  CaptureActivationEvent(Event const & in_event) : Event(in_event)
2233  {
2234  if (in_event.GetChannel() == Object::ClassID<CaptureActivationEvent>())
2235  {
2236  auto that = static_cast<CaptureActivationEvent const &>(in_event);
2237  capture = that.capture;
2238  view = that.view;
2239  }
2240  else
2241  throw HPS::InvalidSpecificationException("Invalid Event Type to Cast From.");
2242  }
2243 
2245 
2248  Event * Clone() const
2249  {
2250  CaptureActivationEvent * new_event = new CaptureActivationEvent(*this);
2251  return new_event;
2252  }
2253 
2254  Capture capture;
2255  View view;
2256 };
2257 
2258 
2260 class SPRK_API CADModel : public Component
2261 {
2262 public:
2264  CADModel();
2265 
2269  CADModel(Component const & in_that);
2270 
2273  CADModel(CADModel const & in_that);
2274 
2277  CADModel(CADModel && in_that);
2278 
2281  CADModel(Model const & in_that);
2282 
2283  virtual ~CADModel();
2284 
2285  HPS::Type ObjectType() const { return HPS::Type::CADModel; }
2286 
2287 #ifndef _MSC_VER
2288  CADModel & operator=(CADModel const & in_that) = default;
2289 #endif
2290 
2294  CADModel & operator=(CADModel && in_that);
2295 
2296 
2300  Component GetComponentFromKey(Key const & in_key) const;
2301 
2306  ComponentPath GetComponentPath(KeyPath const & in_key_path) const;
2307 
2313  ComponentPath GetComponentPath(SelectionItem const & in_item) const;
2314 
2315 
2318  Model GetModel() const;
2319 
2322  FilterArray GetAllFilters() const;
2323 
2326  CaptureArray GetAllCaptures() const;
2327 
2331  FilterArray GetActiveFilters(View const & in_view) const;
2332 
2333 
2337  View ActivateDefaultCapture();
2338 
2339 
2347  void ResetVisibility(Canvas & in_canvas, size_t in_layer = 0);
2348 };
2349 
2350 
2351 
2354 class SPRK_API Metadata : public Sprocket
2355 {
2356 public:
2358  Metadata();
2359 
2362  Metadata(Metadata const & in_that);
2363 
2366  Metadata(Metadata && in_that);
2367 
2370  Metadata(char const * in_name);
2371 
2372  virtual ~Metadata();
2373 
2374  HPS::Type ObjectType() const { return HPS::Type::Metadata; }
2375 
2376 
2380  Metadata & operator=(Metadata const & in_that);
2381 
2385  Metadata & operator=(Metadata && in_that);
2386 
2390  virtual void Assign(Metadata const & in_that);
2391 
2395  bool Equals(Metadata const & in_that) const;
2396 
2400  bool operator!=(Metadata const & in_that) const;
2401 
2405  bool operator==(Metadata const & in_that) const;
2406 
2407 
2410  HPS::UTF8 GetName() const;
2411 
2414  void SetName(char const * in_name);
2415 };
2416 
2418 class SPRK_API IntegerMetadata : public Metadata
2419 {
2420 public:
2422  IntegerMetadata();
2423 
2427  IntegerMetadata(Metadata const & in_that);
2428 
2431  IntegerMetadata(IntegerMetadata const & in_that);
2432 
2435  IntegerMetadata(IntegerMetadata && in_that);
2436 
2440  IntegerMetadata(char const * in_name, int in_value);
2441 
2442  virtual ~IntegerMetadata();
2443 
2444  HPS::Type ObjectType() const { return HPS::Type::IntegerMetadata; }
2445 
2446 #ifndef _MSC_VER
2447  IntegerMetadata & operator=(IntegerMetadata const & in_that) = default;
2448 #endif
2449 
2453  IntegerMetadata & operator=(IntegerMetadata && in_that);
2454 
2455 
2458  int GetValue() const;
2459 
2462  void SetValue(int in_value);
2463 };
2464 
2466 class SPRK_API UnsignedIntegerMetadata : public Metadata
2467 {
2468 public:
2471 
2475  UnsignedIntegerMetadata(Metadata const & in_that);
2476 
2480 
2484 
2488  UnsignedIntegerMetadata(char const * in_name, unsigned int in_value);
2489 
2490  virtual ~UnsignedIntegerMetadata();
2491 
2492  HPS::Type ObjectType() const { return HPS::Type::UnsignedIntegerMetadata; }
2493 
2494 #ifndef _MSC_VER
2495  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata const & in_that) = default;
2496 #endif
2497 
2501  UnsignedIntegerMetadata & operator=(UnsignedIntegerMetadata && in_that);
2502 
2503 
2506  unsigned int GetValue() const;
2507 
2510  void SetValue(unsigned int in_value);
2511 };
2512 
2514 class SPRK_API DoubleMetadata : public Metadata
2515 {
2516 public:
2518  DoubleMetadata();
2519 
2523  DoubleMetadata(Metadata const & in_that);
2524 
2527  DoubleMetadata(DoubleMetadata const & in_that);
2528 
2531  DoubleMetadata(DoubleMetadata && in_that);
2532 
2536  DoubleMetadata(char const * in_name, double in_value);
2537 
2538  virtual ~DoubleMetadata();
2539 
2540  HPS::Type ObjectType() const { return HPS::Type::DoubleMetadata; }
2541 
2542 #ifndef _MSC_VER
2543  DoubleMetadata & operator=(DoubleMetadata const & in_that) = default;
2544 #endif
2545 
2549  DoubleMetadata & operator=(DoubleMetadata && in_that);
2550 
2551 
2554  double GetValue() const;
2555 
2558  void SetValue(double in_value);
2559 };
2560 
2562 class SPRK_API StringMetadata : public Metadata
2563 {
2564 public:
2566  StringMetadata();
2567 
2571  StringMetadata(Metadata const & in_that);
2572 
2575  StringMetadata(StringMetadata const & in_that);
2576 
2579  StringMetadata(StringMetadata && in_that);
2580 
2584  StringMetadata(char const * in_name, char const * in_value);
2585 
2586  virtual ~StringMetadata();
2587 
2588  HPS::Type ObjectType() const { return HPS::Type::StringMetadata; }
2589 
2590 #ifndef _MSC_VER
2591  StringMetadata & operator=(StringMetadata const & in_that) = default;
2592 #endif
2593 
2597  StringMetadata & operator=(StringMetadata && in_that);
2598 
2599 
2602  UTF8 GetValue() const;
2603 
2606  void SetValue(char const * in_value);
2607 };
2608 
2610 class SPRK_API TimeMetadata : public Metadata
2611 {
2612 public:
2614  TimeMetadata();
2615 
2619  TimeMetadata(Metadata const & in_that);
2620 
2623  TimeMetadata(TimeMetadata const & in_that);
2624 
2627  TimeMetadata(TimeMetadata && in_that);
2628 
2632  TimeMetadata(char const * in_name, unsigned int in_value);
2633 
2634  virtual ~TimeMetadata();
2635 
2636  HPS::Type ObjectType() const { return HPS::Type::TimeMetadata; }
2637 
2638 #ifndef _MSC_VER
2639  TimeMetadata & operator=(TimeMetadata const & in_that) = default;
2640 #endif
2641 
2645  TimeMetadata & operator=(TimeMetadata && in_that);
2646 
2647 
2650  unsigned int GetValue() const;
2651 
2654  HPS::UTF8 GetValueAsString() const;
2655 
2658  void SetValue(unsigned int in_value);
2659 };
2660 
2661 
2663 class SPRK_API BooleanMetadata : public Metadata
2664 {
2665 public:
2667  BooleanMetadata();
2668 
2672  BooleanMetadata(Metadata const & in_that);
2673 
2676  BooleanMetadata(BooleanMetadata const & in_that);
2677 
2680  BooleanMetadata(BooleanMetadata && in_that);
2681 
2685  BooleanMetadata(char const * in_name, bool in_value);
2686 
2687  virtual ~BooleanMetadata();
2688 
2689  HPS::Type ObjectType() const { return HPS::Type::BooleanMetadata; }
2690 
2691 #ifndef _MSC_VER
2692  BooleanMetadata & operator=(BooleanMetadata const & in_that) = default;
2693 #endif
2694 
2698  BooleanMetadata & operator=(BooleanMetadata && in_that);
2699 
2700 
2703  bool GetValue() const;
2704 
2707  void SetValue(bool in_value);
2708 };
2709 
2710 
2711 
2713 class SPRK_API Factory : public Sprocket
2714 {
2715 public:
2716 
2719  static CanvasArray GetCanvases();
2720 
2723  static LayoutArray GetLayouts();
2724 
2727  static ViewArray GetViews();
2728 
2731  static ModelArray GetModels();
2732 
2735  static CADModelArray GetCADModels();
2736 
2742  static Canvas CreateCanvas(HPS::WindowHandle in_window_handle, char const * in_name = "", HPS::ApplicationWindowOptionsKit const & in_options = HPS::ApplicationWindowOptionsKit());
2743 
2748  static Canvas CreateCanvas(char const * in_name = "", HPS::StandAloneWindowOptionsKit const & in_options = HPS::StandAloneWindowOptionsKit());
2749 
2755  static Canvas CreateCanvas(HPS::WindowKey const & in_window_key, HPS::PortfolioKey const & in_portfolio_key = HPS::PortfolioKey(), char const * in_name = "");
2756 
2760  static Layout CreateLayout(char const * in_name = "");
2761 
2765  static View CreateView(char const * in_name = "");
2766 
2770  static Model CreateModel(char const * in_name = "");
2771 
2772 private:
2773  Factory() {}
2774 };
2775 
2785 class SPRK_API AxisTriadOperator : public Operator
2786 {
2787 public:
2788  AxisTriadOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2790  virtual HPS::UTF8 GetName() const { return "HPS_AxisTriadOperator"; }
2791 
2797  virtual bool OnMouseDown(MouseState const & in_state);
2802  virtual bool OnMouseUp(MouseState const & in_state);
2807  virtual bool OnMouseMove(MouseState const & in_state);
2808 
2813  virtual bool OnTouchDown(TouchState const & in_state);
2818  virtual bool OnTouchUp(TouchState const & in_state);
2823  virtual bool OnTouchMove(TouchState const & in_state);
2824 
2825  virtual void OnViewAttached();
2826  virtual void OnViewDetached();
2827 
2828 private:
2829 
2830  bool AxisOrbit(HPS::WindowPoint const & in_loc);
2831  void Transition(HPS::SelectionResults selection_results);
2832  void TranslatePoint(HPS::WindowPoint * point);
2833  bool IsEventRelevant(HPS::Point const & event_location);
2834 
2835  bool operator_active;
2836  HPS::WindowPoint start_point;
2837  HPS::Vector start_sphere_point;
2838  float axis_subwindow_width;
2839  float axis_subwindow_height;
2840  HPS::TouchID tracked_touch_ID;
2841  HPS::Rectangle axis_subwindow;
2842  HPS::SegmentKey axis_triad_segment;
2843 
2844 };
2845 
2848 {
2849 public:
2852  virtual ~SmoothTransitionCompleteEvent();
2853 
2856  SmoothTransitionCompleteEvent(HPS::View const & in_view) : view(in_view)
2857  { channel = HPS::Object::ClassID<SmoothTransitionCompleteEvent>(); }
2858 
2861  Event * Clone() const
2862  {
2864  return new_event;
2865  }
2866 
2870  virtual bool Drop(Event const * in_that_event) const
2871  {
2872  HPS_UNREFERENCED(in_that_event);
2873  return false;
2874  }
2875 
2876  HPS::View view;
2877 };
2878 
2888 class SPRK_API NavigationCubeOperator : public Operator
2889 {
2890 public:
2891  NavigationCubeOperator(MouseButtons in_mouse_trigger = MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger = ModifierKeys());
2892  ~NavigationCubeOperator() { OnViewDetached(); }
2893 
2895  virtual HPS::UTF8 GetName() const { return "HPS_NavigationCubeOperator"; }
2896 
2901  virtual bool OnMouseDown(MouseState const & in_state);
2906  virtual bool OnMouseUp(MouseState const & in_state);
2911  virtual bool OnMouseMove(MouseState const & in_state);
2912 
2916  virtual bool OnTouchDown(TouchState const & in_state);
2921  virtual bool OnTouchUp(TouchState const & in_state);
2926  virtual bool OnTouchMove(TouchState const & in_state);
2927 
2928  virtual void OnViewAttached();
2929  virtual void OnViewDetached();
2930 
2931  virtual void OnModelAttached();
2932 
2933  void UpdateHighlightColor();
2934 
2935  /* Sets a segment as the reference segment. All rotations happen around the reference segment.
2936  By default the reference segment is the View segment.
2937  /param in_segment the segment to rotate around. */
2938  void SetReferenceSegment(HPS::SegmentKey const & in_segment);
2939 
2940  /* Sets a group of segments as the reference segments.
2941  * All rotations happen around the combined bounding box of the reference segments.
2942  By default the reference segment is the View segment.
2943  /param in_segments the segments to rotate around. */
2944  void SetReferenceSegment(HPS::SegmentKeyArray const & in_segments);
2945 
2946  /* Returns the segments used as a reference for rotations
2947  By default the reference segment is the View segment.
2948  /return the segments to rotate around. */
2949  HPS::SegmentKeyArray ShowReferenceSegment();
2950 
2951 private:
2952  void Transition(HPS::SelectionResults selection_results);
2953  bool Orbit(HPS::WindowPoint const & in_loc);
2954  void TranslatePoint(HPS::WindowPoint * point);
2955  bool IsEventRelevant(HPS::Point const & event_location);
2956  bool AreCamerasEqual(HPS::CameraKit const & this_camera, HPS::CameraKit const & that_camera);
2957 
2958  bool operator_active;
2959  HPS::TouchID tracked_touch_ID;
2960  HPS::WindowPoint start_point;
2961  HPS::WindowPoint down_position;
2962  HPS::Vector start_sphere_point;
2963  HPS::SegmentKeyArray reference_segments; //rotation and zooming happen around these segments
2964 
2965  HPS::SegmentKey nav_cube_segment;
2966  HPS::SegmentKey style_segment;
2967  HPS::PortfolioKey portfolio;
2968  HPS::ReferenceKeyArrayArray groups;
2969  HPS::HighlightOptionsKit highlight_options_kit;
2970  HPS::CameraKit previous_camera;
2971  int previous_face;
2972 
2973  HPS::Rectangle nav_cube_subwindow;
2974  float nav_cube_subwindow_width;
2975  float nav_cube_subwindow_height;
2976 
2977  int highlighted_group;
2978 
2979  bool moving;
2980 
2981  class SmoothTransitionCompleteEventHandler : public EventHandler
2982  {
2983  public:
2984  SmoothTransitionCompleteEventHandler(View const & in_view, bool & in_moving)
2985  : handler_view(in_view), handler_moving(&in_moving) {}
2986 
2987  ~SmoothTransitionCompleteEventHandler() { Shutdown(); }
2988 
2989  virtual HandleResult Handle(HPS::Event const * in_event);
2990 
2991  private:
2992  View handler_view;
2993  bool * handler_moving;
2994  };
2995 
2996  SmoothTransitionCompleteEventHandler * handler;
2997 };
2998 
2999 
3000 
3001 
3002 class SceneTreeItem;
3003 typedef std::shared_ptr<SceneTreeItem> SceneTreeItemPtr;
3004 class SceneTree;
3005 typedef std::shared_ptr<SceneTree> SceneTreePtr;
3006 
3009 class SPRK_API SceneTree : public Sprocket
3010 {
3011 public:
3014  enum class ItemType : uint32_t
3015  {
3016  None = 0x00000000,
3017  GenericMask = 0xffff0000,
3018 
3019  Segment = 0x00000001,
3020  Include = 0x00000002,
3021  ConditionalExpression = 0x00000003,
3022  StaticModelSegment = 0x00000004,
3023  AttributeFilter = 0x00000005,
3024 
3025  Geometry = 0x00010000,
3026  CuttingSection = 0x00010001,
3027  Shell = 0x00010002,
3028  Mesh = 0x00010003,
3029  Grid = 0x00010004,
3030  NURBSSurface = 0x00010005,
3031  Cylinder = 0x00010006,
3032  Sphere = 0x00010007,
3033  Polygon = 0x00010008,
3034  Circle = 0x00010009,
3035  CircularWedge = 0x0001000a,
3036  Ellipse = 0x0001000b,
3037  Line = 0x0001000c,
3038  NURBSCurve = 0x0001000d,
3039  CircularArc = 0x0001000e,
3040  EllipticalArc = 0x0001000f,
3041  InfiniteLine = 0x00010010,
3042  InfiniteRay = 0x00010011,
3043  Marker = 0x00010012,
3044  Text = 0x00010013,
3045  Reference = 0x00010014,
3046  DistantLight = 0x00010015,
3047  Spotlight = 0x00010016,
3048 
3049  Attribute = 0x00020000,
3050  Portfolio = 0x00020001,
3051  SegmentStyle = 0x00020002,
3052  NamedStyle = 0x00020003,
3053  MaterialPalette = 0x00020004,
3054  Priority = 0x00020005,
3055  Material = 0x00020006,
3056  Camera = 0x00020007,
3057  ModellingMatrix = 0x00020008,
3058  UserData = 0x00020009,
3059  TextureMatrix = 0x0002000a,
3060  Culling = 0x0002000b,
3061  CurveAttribute = 0x0002000c,
3062  CylinderAttribute = 0x0002000d,
3063  EdgeAttribute = 0x0002000e,
3064  LightingAttribute = 0x0002000f,
3065  LineAttribute = 0x00020010,
3066  MarkerAttribute = 0x00020011,
3067  SurfaceAttribute = 0x00020012,
3068  Selectability = 0x00020013,
3069  SphereAttribute = 0x00020014,
3070  Subwindow = 0x00020015,
3071  TextAttribute = 0x00020016,
3072  Transparency = 0x00020017,
3073  Visibility = 0x00020018,
3074  VisualEffects = 0x00020019,
3075  Performance = 0x00020020,
3076  DrawingAttribute = 0x00020021,
3077  HiddenLineAttribute = 0x00020022,
3078  ContourLine = 0x00020023,
3079  Condition = 0x00020024,
3080  Bounding = 0x00020025,
3081  AttributeLock = 0x00020026,
3082  TransformMask = 0x00020027,
3083  ColorInterpolation = 0x00020028,
3084  CuttingSectionAttribute = 0x00020029,
3085 
3086  // window only attributes
3087  Debugging = 0x00020030,
3088  PostProcessEffects = 0x00020031,
3089  SelectionOptions = 0x00020032,
3090  UpdateOptions = 0x00020033,
3091 
3092  Definition = 0x00040000,
3093  NamedStyleDefinition = 0x00040001,
3094  TextureDefinition = 0x00040002,
3095  LinePatternDefinition = 0x00040003,
3096  GlyphDefinition = 0x00040004,
3097  CubeMapDefinition = 0x00040005,
3098  ImageDefinition = 0x00040006,
3099  MaterialPaletteDefinition = 0x00040007,
3100  ShaderDefinition = 0x00040008,
3101 
3102  Group = 0x00080000,
3103  SegmentGroup = 0x00080100,
3104  GeometryGroup = 0x00080200,
3105  AttributeGroup = 0x00080300,
3106  PortfolioGroup = 0x00080400,
3107  StyleGroup = 0x00080500,
3108  IncludeGroup = 0x00080600,
3109  DefinitionGroup = 0x00180000,
3110  NamedStyleDefinitionGroup = 0x00180700,
3111  TextureDefinitionGroup = 0x00180800,
3112  LinePatternDefinitionGroup = 0x00180900,
3113  GlyphDefinitionGroup = 0x00180a00,
3114  CubeMapDefinitionGroup = 0x00180b00,
3115  ImageDefinitionGroup = 0x00180c00,
3116  MaterialPaletteDefinitionGroup = 0x00180d00,
3117  ShaderDefinitionGroup = 0x00180e00,
3118  CuttingSectionGroup = 0x00080001,
3119  ShellGroup = 0x00080002,
3120  MeshGroup = 0x00080003,
3121  GridGroup = 0x00080004,
3122  NURBSSurfaceGroup = 0x00080005,
3123  CylinderGroup = 0x00080006,
3124  SphereGroup = 0x00080007,
3125  PolygonGroup = 0x00080008,
3126  CircleGroup = 0x00080009,
3127  CircularWedgeGroup = 0x0008000a,
3128  EllipseGroup = 0x0008000b,
3129  LineGroup = 0x0008000c,
3130  NURBSCurveGroup = 0x0008000d,
3131  CircularArcGroup = 0x0008000e,
3132  EllipticalArcGroup = 0x0008000f,
3133  InfiniteLineGroup = 0x00080010,
3134  InfiniteRayGroup = 0x00080011,
3135  MarkerGroup = 0x00080012,
3136  TextGroup = 0x00080013,
3137  ReferenceGroup = 0x00080014,
3138  DistantLightGroup = 0x00080015,
3139  SpotlightGroup = 0x00080016,
3140  };
3141 
3143  SceneTree();
3144 
3147  SceneTree(Canvas const & in_canvas);
3148 
3151  SceneTree(SceneTree const & in_that);
3152 
3155  SceneTree(SceneTree && in_that);
3156 
3157  virtual ~SceneTree();
3158 
3159  virtual HPS::Type ObjectType() const { return HPS::Type::SceneTree; }
3160 
3164  SceneTree & operator=(SceneTree const & in_that);
3165 
3169  SceneTree & operator=(SceneTree && in_that);
3170 
3174  virtual void Assign(SceneTree const & in_that);
3175 
3179  bool Equals(SceneTree const & in_that) const;
3180 
3184  bool operator!=(SceneTree const & in_that) const;
3185 
3189  bool operator==(SceneTree const & in_that) const;
3190 
3191 
3199  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3200 
3203  HighlightOptionsKit GetHighlightOptions() const;
3204 
3205 
3210  void SetGroupingLimit(size_t in_limit);
3211 
3214  size_t GetGroupingLimit() const;
3215 
3216 
3223  void SetRoot(SceneTreeItemPtr const & in_root);
3224 
3227  SceneTreeItemPtr GetRoot() const;
3228 
3229 
3232  virtual void Flush();
3233 };
3234 
3235 
3238 class SPRK_API SceneTreeItem : public Sprocket
3239 {
3240 public:
3242  SceneTreeItem();
3243 
3246  SceneTreeItem(SceneTreeItem const & in_that);
3247 
3250  SceneTreeItem(SceneTreeItem && in_that);
3251 
3257  SceneTreeItem(SceneTreePtr const & in_tree, Model const & in_model);
3258 
3264  SceneTreeItem(SceneTreePtr const & in_tree, View const & in_view);
3265 
3271  SceneTreeItem(SceneTreePtr const & in_tree, Layout const & in_layout);
3272 
3278  SceneTreeItem(SceneTreePtr const & in_tree, Canvas const & in_canvas);
3279 
3287  SceneTreeItem(SceneTreePtr const & in_tree, Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr);
3288 
3289  virtual ~SceneTreeItem();
3290 
3291  HPS::Type ObjectType() const { return HPS::Type::SceneTreeItem; }
3292 
3296  SceneTreeItem & operator=(SceneTreeItem const & in_that);
3297 
3301  SceneTreeItem & operator=(SceneTreeItem && in_that);
3302 
3306  virtual void Assign(SceneTreeItem const & in_that);
3307 
3311  bool Equals(SceneTreeItem const & in_that) const;
3312 
3316  bool operator!=(SceneTreeItem const & in_that) const;
3317 
3321  bool operator==(SceneTreeItem const & in_that) const;
3322 
3323 
3326  SceneTreePtr GetTree() const;
3327 
3330  UTF8 GetTitle() const;
3331 
3334  SceneTree::ItemType GetItemType() const;
3335 
3339  bool HasItemType(SceneTree::ItemType in_mask) const;
3340 
3343  Key GetKey() const;
3344 
3347  bool HasChildren() const;
3348 
3349 
3358  virtual SceneTreeItemPtr AddChild(Key const & in_key, SceneTree::ItemType in_type, char const * in_title = nullptr) = 0;
3359 
3360 
3363  virtual void Expand();
3364 
3367  virtual void Collapse();
3368 
3369 
3374  bool IsSelected() const;
3375 
3381  virtual void Select();
3382 
3388  virtual void Unselect();
3389 
3394  bool IsHighlightable() const;
3395 
3401  bool IsHighlighted() const;
3402 
3406  void Highlight();
3407 
3412  void Unhighlight();
3413 };
3414 
3415 
3416 
3417 class ComponentTreeItem;
3418 typedef std::shared_ptr<ComponentTreeItem> ComponentTreeItemPtr;
3419 class ComponentTree;
3420 typedef std::shared_ptr<ComponentTree> ComponentTreePtr;
3421 
3424 class SPRK_API ComponentTree : public Sprocket
3425 {
3426 public:
3429  enum class ItemType
3430  {
3431  None,
3432  ExchangeComponent,
3433  ExchangeModelFile,
3434 
3435  ExchangeViewGroup,
3436  ExchangeAnnotationViewGroup,
3437  ExchangePMIGroup,
3438  ExchangeModelGroup,
3439 
3440  ParasolidComponent,
3441  ParasolidModelFile,
3442  };
3443 
3445  ComponentTree();
3446 
3450  ComponentTree(Canvas const & in_canvas, size_t in_layer = 0);
3451 
3454  ComponentTree(ComponentTree const & in_that);
3455 
3458  ComponentTree(ComponentTree && in_that);
3459 
3460  virtual ~ComponentTree();
3461 
3462  virtual HPS::Type ObjectType() const { return HPS::Type::ComponentTree; }
3463 
3467  ComponentTree & operator=(ComponentTree const & in_that);
3468 
3472  ComponentTree & operator=(ComponentTree && in_that);
3473 
3477  virtual void Assign(ComponentTree const & in_that);
3478 
3482  bool Equals(ComponentTree const & in_that) const;
3483 
3487  bool operator!=(ComponentTree const & in_that) const;
3488 
3492  bool operator==(ComponentTree const & in_that) const;
3493 
3494 
3502  void SetHighlightOptions(HighlightOptionsKit const & in_options);
3503 
3506  HighlightOptionsKit GetHighlightOptions() const;
3507 
3508 
3515  void SetRoot(ComponentTreeItemPtr const & in_root);
3516 
3519  ComponentTreeItemPtr GetRoot() const;
3520 
3521 
3524  virtual void Flush();
3525 };
3526 
3527 
3530 class SPRK_API ComponentTreeItem : public Sprocket
3531 {
3532 public:
3535 
3538  ComponentTreeItem(ComponentTreeItem const & in_that);
3539 
3543 
3549  ComponentTreeItem(ComponentTreePtr const & in_tree, CADModel const & in_cad_model);
3550 
3557  ComponentTreeItem(ComponentTreePtr const & in_tree, Component const & in_component, ComponentTree::ItemType in_type);
3558 
3559  virtual ~ComponentTreeItem();
3560 
3561  HPS::Type ObjectType() const { return HPS::Type::ComponentTreeItem; }
3562 
3566  ComponentTreeItem & operator=(ComponentTreeItem const & in_that);
3567 
3571  ComponentTreeItem & operator=(ComponentTreeItem && in_that);
3572 
3576  virtual void Assign(ComponentTreeItem const & in_that);
3577 
3581  bool Equals(ComponentTreeItem const & in_that) const;
3582 
3586  bool operator!=(ComponentTreeItem const & in_that) const;
3587 
3591  bool operator==(ComponentTreeItem const & in_that) const;
3592 
3593 
3594 
3597  ComponentTreePtr GetTree() const;
3598 
3601  UTF8 GetTitle() const;
3602 
3605  ComponentTree::ItemType GetItemType() const;
3606 
3609  Component GetComponent() const;
3610 
3613  bool HasChildren() const;
3614 
3617  ComponentPath GetPath() const;
3618 
3619 
3627  virtual ComponentTreeItemPtr AddChild(Component const & in_component, ComponentTree::ItemType in_type) = 0;
3628 
3629 
3632  virtual void Expand();
3633 
3636  virtual void Collapse();
3637 
3638 
3644  bool IsHighlighted() const;
3645 
3650  virtual void OnHighlight(HighlightOptionsKit const & in_options);
3651 
3656  virtual void OnUnhighlight(HighlightOptionsKit const & in_options);
3657 
3658 
3662  void Highlight();
3663 
3667  void Unhighlight();
3668 
3669 
3679  bool IsHidden() const;
3680 
3684  virtual void OnHide();
3685 
3689  virtual void OnShow();
3690 
3694  void Hide();
3695 
3699  void Show();
3700 
3705  void Isolate();
3706 
3709  bool IsExpanded() const;
3710 };
3711 
3712 
3713 
3714 
3715 }
3716 #endif
3717 
3718 
3719 
Definition: sprk.h:2610
HPS::Type ObjectType() const
Definition: sprk.h:2444
Definition: hps.h:6012
HPS::Type ObjectType() const
Definition: sprk.h:437
Event * Clone() const
Definition: sprk.h:678
Definition: sprk.h:2785
Definition: sprk.h:238
ComponentHighlightEvent(Event const &in_event)
Definition: sprk.h:2046
HPS::Type ObjectType() const
Definition: sprk.h:246
virtual bool OnTimerTick(HPS::TimerTickEvent const &in_event)
Definition: sprk.h:1059
Definition: hps.h:37869
Definition: hps.h:1487
ComponentHighlightEvent()
Definition: sprk.h:2028
void SetModifierTrigger(ModifierKeys in_modifiers)
Definition: sprk.h:1085
Definition: hps.h:460
HPS::Type ObjectType() const
Definition: sprk.h:215
HPS::Type ObjectType() const
Definition: sprk.h:976
virtual bool OnKeyDown(KeyboardState const &in_state)
Definition: sprk.h:1049
HPS::Type ObjectType() const
Definition: sprk.h:2097
An InvalidSpecificationException is thrown when a method is called with non-sensical or contradictory...
Definition: hps.h:5530
Location
Definition: sprk.h:1255
ModifierKeys GetModifierTrigger() const
Definition: sprk.h:1088
virtual bool OnKeyUp(KeyboardState const &in_state)
Definition: sprk.h:1054
ItemType
Definition: sprk.h:3429
Definition: hps.h:5570
CaptureActivationEvent()
Definition: sprk.h:2218
Definition: sprk.h:69
Definition: sprk.h:212
Definition: sprk.h:600
Definition: sprk.h:105
virtual bool OnMouseMove(MouseState const &in_state)
Definition: sprk.h:1014
Definition: sprk.h:3530
virtual bool OnMouseEnter(MouseState const &in_state)
Definition: sprk.h:1024
Definition: sprk.h:2663
HPS::Type ObjectType() const
Definition: sprk.h:2285
Definition: hps.h:37656
Definition: hps.h:1318
Definition: hps.h:1041
HPS::Type ObjectType() const
Definition: sprk.h:1796
Definition: hps.h:1659
ModelDeletedEvent()
Definition: sprk.h:886
SmoothTransitionCompleteEvent(HPS::View const &in_view)
Definition: sprk.h:2856
Definition: sprk.h:3424
Definition: hps.h:41980
Definition: sprk.h:927
virtual bool OnTouchUp(TouchState const &in_state)
Definition: sprk.h:1039
Definition: hps.h:7387
MouseButtons GetMouseTrigger() const
Definition: sprk.h:1080
virtual HPS::Type ObjectType() const
Definition: sprk.h:3159
Definition: hps.h:3399
Definition: hps.h:1986
Definition: sprk.h:837
bool HasAll(MouseButtons in_mouse_trigger, ModifierKeys in_modifier_trigger) const
Event * Clone() const
Definition: sprk.h:722
Definition: sprk.h:688
Definition: hps.h:1377
Definition: hps.h:872
HPS::Type ObjectType() const
Definition: sprk.h:1418
UpdateControl
Definition: hps.h:168
Definition: hps.h:37774
virtual void OnModelDetached()
Definition: sprk.h:1073
Definition: hps.h:1705
Definition: hps.h:1516
Definition: hps.h:8588
Definition: hps.h:229
void SetMouseTrigger(MouseButtons in_buttons)
Definition: sprk.h:1076
ComponentPath & Append(Component const &in_component)
Definition: hps.h:1757
Event * Clone() const
Definition: sprk.h:828
Definition: hps.h:41879
Definition: hps.h:36765
Definition: sprk.h:1251
Definition: sprk.h:882
Definition: sprk.h:497
HPS::Type ObjectType() const
Definition: sprk.h:112
ViewDetachedEvent(Event const &in_event)
Definition: sprk.h:764
virtual void OnViewDetached()
Definition: sprk.h:1065
Definition: hps.h:36811
HPS::Type ObjectType() const
Definition: sprk.h:3291
LayoutDeletedEvent()
Definition: sprk.h:692
Event * Clone() const
Definition: sprk.h:872
virtual void OnViewAttached()
Definition: sprk.h:1062
Definition: hps.h:36281
Definition: hps.h:39015
Definition: hps.h:1080
Definition: sprk.h:2354
LayoutDetachedEvent()
Definition: sprk.h:647
Definition: sprk.h:2466
virtual bool OnMouseLeave(MouseState const &in_state)
Definition: sprk.h:1029
Definition: hps.h:9189
Definition: hps.h:37817
Definition: hps.h:1464
SmoothTransitionCompleteEvent()
Definition: sprk.h:2851
Definition: hps.h:1403
HPS::Type ObjectType() const
Definition: sprk.h:504
virtual bool OnMouseUp(MouseState const &in_state)
Definition: sprk.h:1009
FilterActivationEvent()
Definition: sprk.h:2130
Definition: hps.h:1422
virtual void OnModelAttached()
Definition: sprk.h:1069
Definition: hps.h:34751
FilterActivationEvent(Event const &in_event)
Definition: sprk.h:2144
ModelDetachedEvent(Event const &in_event)
Definition: sprk.h:856
HPS::Type ObjectType() const
Definition: sprk.h:1283
HPS::Type ObjectType() const
Definition: sprk.h:1618
Definition: hps.h:6760
Location
Definition: sprk.h:1390
Definition: hps.h:41371
Definition: sprk.h:2418
Definition: sprk.h:1386
Definition: hps.h:39187
HPS::Type ObjectType() const
Definition: sprk.h:1130
SprocketControl & operator=(SprocketControl &&in_that)
Definition: sprk.h:228
Definition: hps.h:40532
virtual UTF8 GetName() const
Definition: sprk.h:999
Definition: hps.h:41767
Definition: sprk.h:643
Event * Clone() const
Definition: sprk.h:2161
CaptureActivationEvent(Event const &in_event)
Definition: sprk.h:2232
virtual bool OnTouchDown(TouchState const &in_state)
Definition: sprk.h:1034
HPS::Type ObjectType() const
Definition: sprk.h:2540
CanvasDeletedEvent()
Definition: sprk.h:604
virtual bool OnMouseWheel(MouseState const &in_state)
Definition: sprk.h:1019
HPS::Type ObjectType() const
Definition: sprk.h:2374
HPS::Type ObjectType() const
Definition: sprk.h:2492
SprocketControl(SprocketControl &&in_that)
Definition: sprk.h:223
Event * Clone() const
Definition: sprk.h:2248
Definition: hps.h:14259
ViewDeletedEvent()
Definition: sprk.h:798
intptr_t GetChannel() const
Definition: hps.h:6145
Definition: sprk.h:731
virtual bool Drop(Event const *in_that_event) const
Definition: sprk.h:2870
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2790
Definition: sprk.h:1512
Definition: hps.h:39464
Definition: hps.h:41020
ViewDeletedEvent(Event const &in_event)
Definition: sprk.h:813
Definition: hps.h:38205
Definition: hps.h:34352
Definition: sprk.h:2562
ViewDetachedEvent()
Definition: sprk.h:742
Definition: hps.h:6112
Definition: sprk.h:1108
Definition: hps.h:396
HPS::Type ObjectType() const
Definition: sprk.h:2588
Event * Clone() const
Definition: sprk.h:2063
Definition: sprk.h:430
CanvasDeletedEvent(Event const &in_event)
Definition: sprk.h:619
Definition: sprk.h:2888
Definition: sprk.h:1765
ComponentType
Definition: sprk.h:1517
Definition: hps.h:40458
Definition: hps.h:7015
Definition: sprk.h:2017
Event * Clone() const
Definition: sprk.h:634
LayoutDetachedEvent(Event const &in_event)
Definition: sprk.h:662
HPS::Type ObjectType() const
Definition: sprk.h:3561
virtual bool OnMouseDown(MouseState const &in_state)
Definition: sprk.h:1004
ItemType
Definition: sprk.h:3014
Definition: sprk.h:2076
Definition: sprk.h:2713
virtual HPS::UTF8 GetName() const
Definition: sprk.h:2895
Definition: sprk.h:189
Definition: sprk.h:2847
Definition: hps.h:416
Event * Clone() const
Definition: sprk.h:916
Definition: sprk.h:2174
Definition: hps.h:2004
ModelDetachedEvent()
Definition: sprk.h:841
static MouseButtons ButtonLeft()
Definition: hps.h:41489
virtual HPS::Type ObjectType() const
Definition: sprk.h:3462
Definition: sprk.h:3009
Definition: sprk.h:2514
Definition: hps.h:8626
HPS::Type ObjectType() const
Definition: sprk.h:937
virtual bool IsMouseTriggered(MouseState const &in_state)
Definition: sprk.h:1091
Definition: hps.h:7309
Definition: sprk.h:2119
Definition: hps.h:33968
Definition: hps.h:339
Event * Clone() const
Definition: sprk.h:2861
ModelDeletedEvent(Event const &in_event)
Definition: sprk.h:901
Event * Clone() const
Definition: sprk.h:782
LayoutDeletedEvent(Event const &in_event)
Definition: sprk.h:707
Definition: hps.h:8828
Definition: hps.h:10223
virtual bool OnTouchMove(TouchState const &in_state)
Definition: sprk.h:1044
Definition: sprk.h:3238
Definition: sprk.h:2260
Mode
Definition: sprk.h:194
Definition: hps.h:506
Definition: sprk.h:968
Definition: hps.h:1122
Definition: hps.h:37701
Definition: sprk.h:794
Definition: sprk.h:2214
Definition: hps.h:36344
HPS::Type ObjectType() const
Definition: sprk.h:2636
HPS::Type ObjectType() const
Definition: sprk.h:2195
HPS::Type ObjectType() const
Definition: sprk.h:2689