1 /*
2  * NodePrimitivePickSensor.cpp
3  *
4  * Copyright (C) 2009 J. "MUFTI" Scheurich
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program (see the file "COPYING" for details); if
18  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19  * Cambridge, MA 02139, USA.
20  */
21 
22 #include <stdio.h>
23 #include "stdafx.h"
24 
25 #include "NodePrimitivePickSensor.h"
26 #include "Proto.h"
27 #include "FieldValue.h"
28 #include "SFBool.h"
29 #include "MFString.h"
30 #include "SFNode.h"
31 #include "MFNode.h"
32 #include "SFString.h"
33 #include "SFString.h"
34 #include "DuneApp.h"
35 
ProtoPrimitivePickSensor(Scene * scene)36 ProtoPrimitivePickSensor::ProtoPrimitivePickSensor(Scene *scene)
37   : Proto(scene, "PrimitivePickSensor")
38 {
39     enabled.set(
40         addExposedField(SFBOOL, "enabled", new SFBool(true)));
41     objectType.set(
42         addExposedField(MFSTRING, "objectType", new MFString("ALL")));
43     pickingGeometry.set(
44         addExposedField(SFNODE, "pickingGeometry", new SFNode(),
45                         PRIMITIVE_GEOMETRY_NODE));
46     pickTarget.set(
47         addExposedField(MFNODE, "pickTarget", new MFNode(),
48                         GROUPING_NODE | SHAPE_OR_INLINE_NODE));
49     intersectionType.set(
50         addField(SFSTRING, "intersectionType", new SFString("BOUNDS")));
51     sortOrder.set(
52         addField(SFSTRING, "sortOrder", new SFString("CLOSEST")));
53 }
54 
55 Node *
create(Scene * scene)56 ProtoPrimitivePickSensor::create(Scene *scene)
57 {
58     return new NodePrimitivePickSensor(scene, this);
59 }
60 
NodePrimitivePickSensor(Scene * scene,Proto * def)61 NodePrimitivePickSensor::NodePrimitivePickSensor(Scene *scene, Proto *def)
62   : Node(scene, def)
63 {
64 }
65