16 #ifndef CLOSE_EVENT_SELECTOR 17 #define CLOSE_EVENT_SELECTOR 42 vector<boost::shared_ptr<Event> >* events = r->getEvents();
46 for (
unsigned int i = 0 ; i < events->size() - 1 ; i++)
48 boost::shared_ptr<Event> ev1 = events->at(i);
49 boost::shared_ptr<Event> ev2 = events->at(i + 1);
50 int type1 = events->at(i)->getType();
51 int type2 = events->at(i + 1)->getType();
52 Shape* sh1 = NULL, *sh2 = NULL, *sh3 = NULL;
60 sh1 =
dynamic_cast<Cylindre*
>(ev1->getShape())->getFirstShape();
61 sh2 =
dynamic_cast<Cylindre*
>(ev1->getShape())->getSecondShape();
62 sh3 = ev2->getShape();
66 sh1 =
dynamic_cast<Cylindre*
>(ev2->getShape())->getFirstShape();
67 sh2 =
dynamic_cast<Cylindre*
>(ev2->getShape())->getSecondShape();
68 sh3 = ev1->getShape();
80 vector<boost::shared_ptr<Event> >* events = r->getEvents();
82 if (events->size() < 2) {
return true; }
84 for (
unsigned int i = 0 ; i < events->size() - 1 ; i++)
86 boost::shared_ptr<Event> ev1 = events->at(i);
87 boost::shared_ptr<Event> ev2 = events->at(i + 1);
88 int type1 = events->at(i)->getType();
89 int type2 = events->at(i + 1)->getType();
90 Shape* sh1 = NULL, *sh2 = NULL, *sh3 = NULL;
98 sh1 =
dynamic_cast<Cylindre*
>(ev1->getShape())->getFirstShape();
99 sh2 =
dynamic_cast<Cylindre*
>(ev1->getShape())->getSecondShape();
100 sh3 = ev2->getShape();
104 sh1 =
dynamic_cast<Cylindre*
>(ev2->getShape())->getFirstShape();
105 sh2 =
dynamic_cast<Cylindre*
>(ev2->getShape())->getSecondShape();
106 sh3 = ev1->getShape();
109 if ((sh3 == sh1) || (sh3 == sh2)) {
return false; }
120 return typeid(
this).
name();
126 #endif //CLOSE_EVENT_SELECTOR CloseEventSelector()
Constructor.
bool deletable
Flag to know if the selector may be deleted or not.
Rejects a ray if two of its events occur on the same shape (for example a diffraction close to a refl...
virtual Selector< T > * Copy()
Copy Selector.
virtual bool insertWithTest(T *r)
Select the ray if it respects the criteria of this Selector.
Base class for Selector (used to keep or disable rays according different criterias) ...
virtual SELECTOR_RESPOND canBeInserted(T *r, unsigned long long &replace)
Check if the ray respects the criteria of this Selector and return a SELECTOR_RESPOND.
virtual const char * getSelectorName()
Return the class type of the selector.
void setIsDeletable(bool _isDeletable)
Set deletable flag.
base class for shapes (Cylindre, Mesh, Sphere, Triangle,...)