Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

HOpSelectAreaOOC.h
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 
10 #pragma once
11 
12 
13 #ifdef HMFC_STATIC_LIB
14 # error "Code cannot be statically linked."
15 #endif
16 
17 
18 #ifdef H_PACK_8
19 # pragma pack(push)
20 # pragma pack(8)
21 #endif
22 
23 
25 
26 
27 #include "HOpSelectArea.h"
28 #include "HSelectionSetOOC.h"
29 
30 
32 
33 
39 template <typename SelectionSet>
41 public:
46  : HOpSelectArea(&view)
47  {}
48 
51  virtual char const * GetName ()
52  {
53  return "HOpSelectAreaOOC";
54  }
55 
60  virtual HBaseOperator * Clone ()
61  {
62  return new HOpSelectAreaOOC(*GetView());
63  }
64 
69  virtual int OnLButtonDown (HEventInfo & e)
70  {
71  if (!e.Control()) {
72  GetSelectionSet().DeSelectAll();
73  }
75  }
76 
82  virtual int OnLButtonUp (HEventInfo & e)
83  {
84  HSelectionSetOOC<SelectionSet> & selset = GetSelectionSet();
85 
86  return selset.SynchronizeWith([&]() -> int {
87 
88  HC_Control_Update_By_Key(0, "flush proxies and lock database");
89  {
90  HBaseView & view = *GetView();
91  HC_Open_Segment_By_Key(view.GetViewKey());
92  HC_Set_Driver_Options("inspect proxies");
93  HC_Close_Segment();
94  }
95  HC_Control_Update_By_Key(0, "unlock database");
96 
97  int const result = HOpSelectArea::OnLButtonUp(e);
98 
99  if (m_ptRectangle[0].x == m_ptRectangle[1].x &&
100  m_ptRectangle[0].y == m_ptRectangle[1].y)
101  {
102  ;
103  }
104  else
105  {
106  ooc::Point window_min(m_ptRectangle[0].x, m_ptRectangle[0].y, 0);
107  ooc::Point window_max(m_ptRectangle[1].x, m_ptRectangle[1].y, 0);
108 
109  selset.AddRectangleWindow(window_min, window_max);
110  }
111 
112  if (!selset.HasWindows())
113  {
114  HBaseView & view = *GetView();
115  HC_Open_Segment_By_Key(view.GetViewKey());
116  HC_Set_Driver_Options("no inspect proxies");
117  HC_Close_Segment();
118 
119  HC_Inspect_Proxies(0, 0);
120  }
121 
122  return result;
123  });
124  }
125 
126 private:
127  HSelectionSetOOC<SelectionSet> & GetSelectionSet ()
128  {
129  HBaseView & view = *GetView();
130  HSelectionSet & selset = *view.GetSelection();
131  return static_cast<HSelectionSetOOC<SelectionSet> &>(selset);
132  }
133 };
134 
135 
136 
Definition: HSelectionSetOOC.h:77
virtual char const * GetName()
Definition: HOpSelectAreaOOC.h:51
virtual int OnLButtonUp(HEventInfo &hevent)
HC_KEY GetViewKey()
Definition: HBaseView.h:915
The HSelectionSet class manages a list of selected items.
Definition: HSelectionSet.h:66
virtual int OnLButtonDown(HEventInfo &hevent)
bool Control() const
Definition: HEventInfo.h:292
void AddRectangleWindow(ooc::Point const &min, ooc::Point const &max)
Definition: HSelectionSetOOC.h:408
HSelectionSet * GetSelection()
Definition: HBaseView.h:696
auto SynchronizeWith(Func const &task) -> decltype(task())
Definition: HSelectionSetOOC.h:436
The HBaseOperator class serves as a base for classes which handle user input and operate on the scene...
Definition: HBaseOperator.h:60
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
virtual int OnLButtonUp(HEventInfo &e)
Definition: HOpSelectAreaOOC.h:82
virtual int OnLButtonDown(HEventInfo &e)
Definition: HOpSelectAreaOOC.h:69
virtual HBaseOperator * Clone()
Definition: HOpSelectAreaOOC.h:60
HOpSelectAreaOOC(HBaseView &view)
Definition: HOpSelectAreaOOC.h:45
HBaseView * GetView()
Returns a pointer to the view that this operator is associated with.
Definition: HBaseOperator.h:103
HPoint m_ptRectangle[2]
Definition: HOpConstructRectangle.h:100
The HOpSelectArea class computes a selection list for objects inside a rectangular area...
Definition: HOpSelectArea.h:38
The HEventInfo class stores and manages event information.
Definition: HEventInfo.h:207
Definition: HOpSelectAreaOOC.h:40