-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHSAcisSelectionSet.cpp
More file actions
694 lines (598 loc) · 18.9 KB
/
HSAcisSelectionSet.cpp
File metadata and controls
694 lines (598 loc) · 18.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
//
// Copyright (c) 2000 by Tech Soft 3D, LLC.
// The information contained herein is confidential and proprietary to
// Tech Soft 3D, LLC., and considered a trade secret as defined under
// civil and criminal statutes. Tech Soft 3D shall pursue its civil
// and criminal remedies in the event of unauthorized use or misappropriation
// of its trade secrets. Use of this information by anyone other than
// authorized employees of Tech Soft 3D, LLC. is granted only under a
// written non-disclosure agreement, expressly prescribing the scope and
// manner of such use.
//
// $Id: 0cf08cbbacd7540cbeb2422309da639d65d61d1b $
//
// HSAcisSelectionSet.cpp : implementation of the HPSelectionSet class
//
#include "stdafx.h"
#include "resource.h"
#include "HSInclude.h"
#include "HSSelectionSet.h"
#include "HSAcisSelectionSet.h"
#include "topolbrowserdlg.h"
#include "HSAcisSelectionSet.h"
#include "HSolidModel.h"
#include "HSolidView.h"
#include "vlist.h"
HSAcisSelectionSet::HSAcisSelectionSet(HBaseView* view) : HSSelectionSet(view)
{
m_SelectLevel = BODY_TYPE; // set default level to body
m_bMultiSelectActive = false;
SetAllowEntitySelection(true);
}
void HSAcisSelectionSet::Select(HC_KEY key, int num_include_keys, HC_KEY * include_keys, bool emit_message)
{
HC_KEY keys[40000];
int count = 0, c;
ENTITY* entity = 0;
KERN_CLASS_TYPEDEF SelectLevel = m_SelectLevel;
if (m_bMultiSelectActive)
{
char type[MVO_BUFFER_SIZE];
HC_Show_Key_Type(key, type);
if (strcmp(type, "segment") == 0)
SelectLevel = BODY_TYPE;
if (strcmp(type, "shell") == 0)
SelectLevel = FACE_TYPE;
else if (strcmp(type, "marker") == 0)
SelectLevel = VERTEX_TYPE;
else
SelectLevel = EDGE_TYPE;
}
if (((HSolidModel *) m_pView->GetModel())->m_bSolidModel != true)
{
char type[MVO_BUFFER_SIZE];
HC_KEY segkey;
HC_Show_Key_Type(key, type);
if (!streq(type, "segment"))
segkey = HC_KShow_Owner_By_Key(key);
else
segkey = key;
HSelectionSet::Select(segkey, num_include_keys, include_keys, emit_message);
}
else
{
if (m_pView->GetRenderMode() == HRenderHiddenLine && SelectLevel==FACE_TYPE)
{
entity = HA_Compute_Entity_Pointer(key, FACE_TYPE);
if (entity)
{
vlist_add_last(m_pSolidSelection, (void*)entity);
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
for (c = 0; c < count; c++)
HSelectionSet::Select(keys[c], num_include_keys, include_keys, emit_message); // call base class fcn for each key
ENTITY_LIST edges;
int num_edges;
outcome o = api_get_edges( entity, edges );
CHECK_OUTCOME(o);
num_edges = edges.iteration_count();
for (int i=0;i<num_edges;i++)
{
count = HA_Compute_Geometry_Keys(edges[i], 40000, keys, "edges");
for (c = 0; c < count; c++)
HSelectionSet::Select(keys[c], num_include_keys, include_keys, emit_message); // call base class fcn for each key
}
}
}
else
{
if(SelectLevel == KERN_INSTANCE_TYPE)
{
// TODO: Use the component HA apis when they are available
HC_KEY* pReversePath = new HC_KEY[num_include_keys];
for(int i = 0; i < num_include_keys; i++)
{
pReversePath[i] = include_keys[num_include_keys-1-i];
}
component_entity_handle* pCompEntity = HA_Compute_Component_Entity_Pointer(num_include_keys, pReversePath);
if(pCompEntity && pCompEntity->component())
count = HA_Compute_Component_Keys(pCompEntity->component(), 40000, keys);
}
else
{
entity = HA_Compute_Entity_Pointer(key, SelectLevel);
if (entity)
{
vlist_add_last(m_pSolidSelection, (void*)entity);
if (SelectLevel == BODY_TYPE) // && body segments is true
{
count = HA_Compute_Geometry_Keys(entity, 1, keys, "bodies");
}
else if (SelectLevel == FACE_TYPE)
{
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "faces");
if (m_bShowFacesAsLines)
{
ENTITY_LIST edges;
int num_edges;
outcome o = api_get_edges( entity, edges );
CHECK_OUTCOME(o);
num_edges = edges.iteration_count();
for (int i=0;i<num_edges;i++)
{
int ecount = HA_Compute_Geometry_Keys(edges[i], 40000-count, &keys[count], "edges");
count += ecount;
}
}
}
else if (SelectLevel == EDGE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
else if (SelectLevel == VERTEX_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "vertices");
}
}
assert(count < 40000);
if (count)
{
for (c = 0; c < count; c++)
{
HSelectionSet::Select(keys[c], num_include_keys, include_keys, emit_message); // call base class fcn for each key
}
}
else
{
// if there is no modeler entity corresponding to this key here, let base class handle
// this is added here so that we are able to select cutting planes, notes etc. in modeler partviewer
// Rajesh B (2-May-03)
HSolidModel *model = (HSolidModel *)m_pView->GetModel();
MultiSelectManager *msm = model->GetMultiSelectManager();
m_bMultiSelectActive = true;
key = msm->MultiSelect(key, m_pView);
m_bMultiSelectActive = false;
HSelectionSet::Select(key, num_include_keys, include_keys, emit_message);
}
}
}
}
void HSAcisSelectionSet::Select(HC_KEY key, const char* segpath, HC_KEY include_key, HC_KEY includer_key, bool emit_message)
{
HC_KEY keys[40000];
int count = 0, c;
ENTITY* entity = 0;
if (((HSolidModel *) m_pView->GetModel())->m_bSolidModel != true)
{
char type[MVO_BUFFER_SIZE];
HC_KEY segkey;
HC_Show_Key_Type(key, type);
if (!streq(type, "segment"))
segkey = HC_KShow_Owner_By_Key(key);
else
segkey = key;
HSelectionSet::Select(segkey, 0, NULL, emit_message);
}
else
{
if (m_pView->GetRenderMode() == HRenderHiddenLine && m_SelectLevel==FACE_TYPE)
{
entity = HA_Compute_Entity_Pointer(key, FACE_TYPE);
if (entity)
{
vlist_add_last(m_pSolidSelection, (void*)entity);
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
for (c = 0; c < count; c++)
HSelectionSet::Select(keys[c], 0, NULL, emit_message); // call base class fcn for each key
ENTITY_LIST edges;
int num_edges;
outcome o = api_get_edges( entity, edges );
CHECK_OUTCOME(o);
num_edges = edges.iteration_count();
for (int i=0;i<num_edges;i++)
{
count = HA_Compute_Geometry_Keys(edges[i], 40000, keys, "edges");
for (c = 0; c < count; c++)
HSelectionSet::Select(keys[c], 0, NULL, emit_message); // call base class fcn for each key
}
}
}
else
{
entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);
if (entity)
{
vlist_add_last(m_pSolidSelection, (void*)entity);
if (m_SelectLevel == BODY_TYPE) // && body segments is true
{
count = HA_Compute_Geometry_Keys(entity, 1, keys, "bodies");
}
else if (m_SelectLevel == FACE_TYPE)
{
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "faces");
if (m_bShowFacesAsLines)
{
ENTITY_LIST edges;
int num_edges;
outcome o = api_get_edges( entity, edges );
CHECK_OUTCOME(o);
num_edges = edges.iteration_count();
for (int i=0;i<num_edges;i++)
{
int ecount = HA_Compute_Geometry_Keys(edges[i], 40000-count, &keys[count], "edges");
count += ecount;
}
}
}
else if (m_SelectLevel == EDGE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
else if (m_SelectLevel == VERTEX_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "vertices");
}
assert(count < 40000);
if (count)
{
for (c = 0; c < count; c++)
{
HSelectionSet::Select(keys[c], 0, NULL, emit_message); // call base class fcn for each key
}
}
else
// if there is no modeler entity corresponding to this key here, let base class handle
// this is added here so that we are able to select cutting planes, notes etc. in modeler partviewer
// Rajesh B (2-May-03)
HSelectionSet::Select(key, 1, &include_key, emit_message);
}
}
}
void HSAcisSelectionSet::Select(ENTITY* entity, bool emit_message)
{
HC_KEY keys[40000];
int count = 0, c;
int eclass;
eclass = entity->identity();
HC_KEY incl_keys[1] = {m_pView->GetIncludeLinkKey()};
if (m_pView->GetRenderMode() == HRenderHiddenLine && eclass == FACE_TYPE)
{
if (entity)
{
vlist_add_last(m_pSolidSelection, (void*)entity);
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
for (c = 0; c < count; c++)
HSelectionSet::Select(keys[c], 1, incl_keys, emit_message); // call base class fcn for each key
ENTITY_LIST edges;
int num_edges;
outcome o = api_get_edges( entity, edges );
CHECK_OUTCOME(o);
num_edges = edges.iteration_count();
for (int i=0;i<num_edges;i++)
{
count = HA_Compute_Geometry_Keys(edges[i], 40000, keys, "edges");
for (c = 0; c < count; c++)
HSelectionSet::Select(keys[c], 1, incl_keys, emit_message); // call base class fcn for each key
}
}
}
else
{
if (entity)
{
vlist_add_last(m_pSolidSelection, (void*)entity);
if (eclass == BODY_TYPE) // && body segments is true
count = HA_Compute_Geometry_Keys(entity, 1, keys, "bodies");
else if (eclass == FACE_TYPE)
{
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "faces");
if (m_bShowFacesAsLines)
{
ENTITY_LIST edges;
int num_edges;
outcome o = api_get_edges( entity, edges );
CHECK_OUTCOME(o);
num_edges = edges.iteration_count();
for (int i=0;i<num_edges;i++)
{
int ecount = HA_Compute_Geometry_Keys(edges[i], 40000-count, &keys[count], "edges");
count += ecount;
}
}
}
else if (eclass == EDGE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
else if (eclass == VERTEX_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "vertices");
}
assert(count < 40000);
if (count)
{
for (c = 0; c < count; c++)
{
HSelectionSet::Select(keys[c], 1, incl_keys, emit_message); // call base class fcn for each key
}
}
}
}
void HSAcisSelectionSet::Select(component_handle* component, bool emit_message)
{
unsigned long n_sel_keys = 0;
n_sel_keys = HA_Compute_Component_Key_Count(component);
if( n_sel_keys > 0 )
{
// highlight the corresponding segments
HC_KEY* sel_keys = new HC_KEY[n_sel_keys];
HA_Compute_Component_Keys(component, n_sel_keys, sel_keys);
for(unsigned long i = 0; i < n_sel_keys; i++)
HSelectionSet::Select(sel_keys[i], 0, NULL, emit_message); // call base class fcn for each key
delete[] sel_keys;
// add to the selection list
// BIG NOTE: component_handle* CANNOT BE ADDED TO THE SELECTION LIST BECAUSE IT IS
// NOT AN ENTITY (UNFORTUNATELY). INSTEAD WE ARE ADDING AN EE_LIST (ENTITY-derived CLASS)
// WHICH IS THE LIST OF ALL ASM_MODEL_REF THAT ARE REQUIRED TO IDENTIFY A component
// Rajesh B. (13-Mar-07)
HSolidModel* pModel = ((HSolidModel *) m_pView->GetModel());
if(pModel)
{
EE_LIST* model_refs = pModel->GetEEListForComponent(component);
if(model_refs)
vlist_add_last(m_pSolidSelection, (void*)model_refs);
}
}
}
void HSAcisSelectionSet::RefreshSolidSelection()
{
ENTITY* entities[40000];
HC_KEY keys[40000];
int count;
int i;
int size=vlist_count(m_pSolidSelection);
for (i=0;i<size;i++)
entities[i]= (ENTITY*)vlist_nth_item(m_pSolidSelection, i);
DeSelectAll();
for (i=0;i<size;i++)
{
vlist_add_last(m_pSolidSelection, (void*)entities[i]);
int eclass;
eclass = entities[i]->identity();
if (eclass == BODY_TYPE) // && 'body segments is true
count = HA_Compute_Geometry_Keys(entities[i], 1, keys, "bodies");
else if (eclass == FACE_TYPE)
{
count = HA_Compute_Geometry_Keys(entities[i], 40000, keys, "faces");
if (m_bShowFacesAsLines /*|| HP_Get_Hash_Level()==1*/)
{
HC_KEY keys[1000];
ENTITY_LIST edges;
int num_edges;
outcome o = api_get_edges( entities[i], edges );
CHECK_OUTCOME(o);
num_edges = edges.iteration_count();
for (int j=0;j<num_edges;j++)
{
int count = HA_Compute_Geometry_Keys(edges[j], 1000, keys, "edges");
for (int c = 0; c < count; c++)
HSelectionSet::Select(keys[c], 0, NULL, true); // call base class fcn for each key
}
}
}
else if (eclass == EDGE_TYPE)
count = HA_Compute_Geometry_Keys(entities[i], 40000, keys, "edges");
else if (eclass == VERTEX_TYPE)
count = HA_Compute_Geometry_Keys(entities[i], 40000, keys, "vertices");
for (int c = 0; c < count; c++)
HSelectionSet::Select(keys[c], 0, NULL, true); // call base class fcn for each key
}
}
void HSAcisSelectionSet::DeSelect(HC_KEY key, int num_include_keys, HC_KEY * include_keys, bool emit_message)
{
HC_KEY keys[40000];
int count = 0, c;
if (((HSolidModel *) m_pView->GetModel())->m_bSolidModel != true)
{
char type[MVO_BUFFER_SIZE];
HC_KEY segkey;
HC_Show_Key_Type(key, type);
if (!streq(type, "segment"))
segkey = HC_KShow_Owner_By_Key(key);
else
segkey = key;
HSelectionSet::DeSelect(segkey, num_include_keys, include_keys, emit_message);
}
else
{
// TODO: Handle de-selection of component_handle
ENTITY* entity = 0;
int n = 0;
entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);
if (entity)
{
vlist_remove(m_pSolidSelection, (void*)entity);
if (m_SelectLevel == BODY_TYPE) // && 'body segments is true
count = HA_Compute_Geometry_Keys(entity, 1, keys, "bodies");
else if (m_SelectLevel == FACE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "faces");
else if (m_SelectLevel == EDGE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
else if (m_SelectLevel == VERTEX_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "vertices");
}
assert(count < 40000);
if (count)
{
for (c = 0; c < count; c++)
{
HSelectionSet::DeSelect(keys[c], emit_message); // call base class fcn for each key
}
}
else
// call the base-class anyway to deselect
HSelectionSet::DeSelect(key, num_include_keys, include_keys, emit_message);
}
}
void HSAcisSelectionSet::DeSelect(HC_KEY key, bool emit_message )
{
HC_KEY keys[40000];
int count = 0, c;
if (((HSolidModel *) m_pView->GetModel())->m_bSolidModel != true)
{
char type[MVO_BUFFER_SIZE];
HC_KEY segkey;
HC_Show_Key_Type(key, type);
if (!streq(type, "segment"))
segkey = HC_KShow_Owner_By_Key(key);
else
segkey = key;
HSelectionSet::DeSelect(segkey, emit_message);
}
else
{
ENTITY* entity = 0;
int n = 0;
entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);
if (entity)
{
vlist_remove(m_pSolidSelection, (void*)entity);
if (m_SelectLevel == BODY_TYPE) // && 'body segments is true
count = HA_Compute_Geometry_Keys(entity, 1, keys, "bodies");
else if (m_SelectLevel == FACE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "faces");
else if (m_SelectLevel == EDGE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
else if (m_SelectLevel == VERTEX_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "vertices");
}
assert(count < 40000);
if (count)
{
for (c = 0; c < count; c++)
{
HSelectionSet::DeSelect(keys[c], emit_message); // call base class fcn for each key
}
}
else
// call the base-class anyway to deselect
HSelectionSet::DeSelect(key, emit_message);
}
}
void HSAcisSelectionSet::DeSelectEntity(ENTITY* entity, bool emit_message )
{
HC_KEY keys[40000];
int count = 0, c;
int n = 0;
if (entity > 0)
{
vlist_remove(m_pSolidSelection, (void*) entity);
if (m_SelectLevel == BODY_TYPE) // && 'body segments is true
count = HA_Compute_Geometry_Keys(entity, 1, keys, "bodies");
else if (m_SelectLevel == FACE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "faces");
else if (m_SelectLevel == EDGE_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "edges");
else if (m_SelectLevel == VERTEX_TYPE)
count = HA_Compute_Geometry_Keys(entity, 40000, keys, "vertices");
}
assert(count < 40000);
if (count)
{
for (c = 0; c < count; c++)
{
HSelectionSet::DeSelect(keys[c], emit_message); // call base class fcn for each key
}
}
}
void HSAcisSelectionSet::DeSelectComponent(component_handle* component, bool emit_message )
{
if (component != NULL)
{
// remove from selection list
HSolidModel* pModel = (HSolidModel*)(m_pView->GetModel());
if( pModel )
{
EE_LIST* pModelRefs = pModel->GetEEListForComponent(component);
if(pModelRefs)
vlist_remove(m_pSolidSelection, (void*) pModelRefs);
}
// de-highlight each key
unsigned long n_sel_keys = 0;
n_sel_keys = HA_Compute_Component_Key_Count(component);
if( n_sel_keys > 0 )
{
// highlight the corresponding segments
HC_KEY* sel_keys = new HC_KEY[n_sel_keys];
HA_Compute_Component_Keys(component, n_sel_keys, sel_keys);
for(unsigned long i = 0; i < n_sel_keys; i++)
HSelectionSet::DeSelect(sel_keys[i], 0, NULL, emit_message); // call base class fcn for each key
delete[] sel_keys;
}
}
}
bool HSAcisSelectionSet::IsSelected(HC_KEY key, int num_include_keys, const HC_KEY * include_keys) const
{
if (((HSolidModel *) m_pView->GetModel())->m_bSolidModel != true)
{
char type[MVO_BUFFER_SIZE];
HC_Show_Key_Type(key, type);
if (!streq(type, "segment"))
key = HC_KShow_Owner_By_Key(key);
return HSelectionSet::IsSelected(key, num_include_keys, include_keys);
}
else
{
// TODO: check for component
if (m_SelectLevel == BODY_TYPE) // && body segments is true
{
ENTITY* entity = 0;
int count;
entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);
if (entity)
{
count = HA_Compute_Geometry_Keys(entity, 1, &key, "bodies");
assert(count == 1);
}
}
return HSelectionSet::IsSelected(key, num_include_keys, include_keys);
}
}
bool HSAcisSelectionSet::IsSelected(HC_KEY key)
{
if (((HSolidModel *) m_pView->GetModel())->m_bSolidModel != true)
{
char type[MVO_BUFFER_SIZE];
HC_Show_Key_Type(key, type);
if (!streq(type, "segment"))
key = HC_KShow_Owner_By_Key(key);
}
else
{
if (m_SelectLevel == BODY_TYPE) // && body segments is true
{
ENTITY* entity = 0;
int count;
entity = HA_Compute_Entity_Pointer(key, m_SelectLevel);
if (entity)
{
count = HA_Compute_Geometry_Keys(entity, 1, &key, "bodies");
assert(count == 1);
}
}
}
// call base class function with the computed key
return HSelectionSet::IsSelected(key,0,0);
}
bool HSAcisSelectionSet::IsSelected(ENTITY* pEntity)
{
int size = vlist_count(m_pSolidSelection);
for( int i = 0; i < size; i++ )
{
if( pEntity == ((ENTITY*)vlist_nth_item(m_pSolidSelection, i)) )
return true;
}
return false;
}
bool HSAcisSelectionSet::IsSelected(component_handle* pComponent)
{
HSolidModel* pModel = (HSolidModel*) m_pView->GetModel();
EE_LIST* pModelRefs = pModel->GetEEListForComponent(pComponent);
int size = vlist_count(m_pSolidSelection);
for( int i = 0; i < size; i++ )
{
if( ((ENTITY*)pModelRefs) == ((ENTITY*)vlist_nth_item(m_pSolidSelection, i)) )
return true;
}
return false;
}