added: travMask to csm viewport
[opensg.git] / Source / Base / Field / testFieldDescFactory.cpp
blob772eb0b2920ecd160890ca3b50fcfdf82d928722
2 #include "stdio.h"
3 #include "OSGNode.h"
4 #include "OSGBaseInitFunctions.h"
5 #include "OSGFieldDescFactory.h"
6 #include "OSGBaseSFields.h"
7 #include "OSGBaseMFields.h"
9 int main (int argc, char **argv)
11 OSG::osgInit(argc, argv);
13 // fprintf(stderr, "%d field types\n");
15 for(OSG::UInt32 i = 0;
16 i < OSG::FieldDescFactory::the()->getNumFieldTypes();
17 ++i )
19 // fprintf(stderr, "Field
22 OSG::FieldDescriptionBase *pDesc =
23 OSG::FieldDescFactory::the()->createByNameIdx(
24 NULL,
25 NULL,
26 NULL,
27 NULL);
29 pDesc = OSG::FieldDescFactory::the()->createByNameIdx(
30 "SFUInt32",
31 "myfield",
32 NULL,
33 NULL);
35 fprintf(stderr, "got %p\n", pDesc);
37 if(pDesc != NULL)
39 pDesc->getFieldType().dump();
42 pDesc = OSG::FieldDescFactory::the()->createByNameIdx(
43 "MFUInt32",
44 "myfield",
45 NULL,
46 NULL);
48 fprintf(stderr, "got %p\n", pDesc);
50 if(pDesc != NULL)
52 pDesc->getFieldType().dump();
56 pDesc = OSG::FieldDescFactory::the()->createIdx(
57 OSG::SFUInt32::getClassType().getId(),
58 "myfield",
59 NULL,
60 NULL);
62 fprintf(stderr, "got %p\n", pDesc);
64 if(pDesc != NULL)
66 pDesc->getFieldType().dump();
69 pDesc = OSG::FieldDescFactory::the()->createIdx(
70 OSG::MFUInt32::getClassType().getId(),
71 "myfield",
72 NULL,
73 NULL);
75 fprintf(stderr, "got %p\n", pDesc);
77 if(pDesc != NULL)
79 pDesc->getFieldType().dump();
84 pDesc = OSG::FieldDescFactory::the()->createIdx(
85 OSG::SFUnrecFieldContainerPtr::getClassType().getId(),
86 "myfield",
87 NULL,
88 NULL);
90 fprintf(stderr, "got %p\n", pDesc);
92 if(pDesc != NULL)
94 pDesc->getFieldType().dump();
97 pDesc = OSG::FieldDescFactory::the()->createIdx(
98 OSG::MFUnrecFieldContainerPtr::getClassType().getId(),
99 "myfield",
100 NULL,
101 NULL);
103 fprintf(stderr, "got %p\n", pDesc);
105 if(pDesc != NULL)
107 pDesc->getFieldType().dump();
111 OSG::osgExit();
113 return 0;