// --------------------------------------------------------------------------
//! Constructor, creates fields
// --------------------------------------------------------------------------
SoView2DLiftChart::SoView2DLiftChart() {
   // Execute inventor internal stuff for node construction.
   SO_NODE_CONSTRUCTOR(SoView2DLiftChart);
   
   SO_NODE_ADD_FIELD(verticalOffset, (100));
   

   //! Set inherited fields to a default state using the default string setting
   //! mechanism available in OpenInventor. E.g. in this case the extension
   //! shall be activated by button 1 and it must be over a valid voxel position
   //! to be activated.
   set("button1 PRESSED button2 IGNORED button3 IGNORED needsValidVoxel FALSE");

   _topOffset = _bottomOffset = 100;
   _leftOffset = 10;
   _currentSlice = 0;
   _width = 0;
   _height = 0;
   _dsl = 0;
   _liftChartData = 0;

   // Create a sensor calling _nodeChangedCB if any field changes. Use a priority 0
   // sensor to be sure that changes are not delayed or collected.
   _nodeSensor = new SoNodeSensor(SoView2DLiftChart::nodeChangedCB, this);
   _nodeSensor->setPriority(0);
   _nodeSensor->attach(this);
}
Ejemplo n.º 2
0
SoXipOverlayFilter::SoXipOverlayFilter()
{
	SO_NODE_CONSTRUCTOR( SoXipOverlayFilter );

	SO_NODE_ADD_FIELD( label, ("") );
	label.setNum(0);
}
Ejemplo n.º 3
0
SoV1Environment::SoV1Environment()
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoV1Environment);

    SO_NODE_ADD_FIELD(ambientIntensity,	(0.2));
    SO_NODE_ADD_FIELD(ambientColor,	(1.0, 1.0, 1.0));
    SO_NODE_ADD_FIELD(attenuation,	(0.0, 0.0, 1.0));
    SO_NODE_ADD_FIELD(fogType,		(NONE));
    SO_NODE_ADD_FIELD(fogComputed,	(PER_VERTEX));
    SO_NODE_ADD_FIELD(fogColor,		(1.0, 1.0, 1.0));
    SO_NODE_ADD_FIELD(fogDensity,	(0.0));
    SO_NODE_ADD_FIELD(fogNearDistance,	(1.0));
    SO_NODE_ADD_FIELD(fogFarDistance,	(10.0));

    // Set up static info for enumerated type fields
    SO_NODE_DEFINE_ENUM_VALUE(Type, NONE);
    SO_NODE_DEFINE_ENUM_VALUE(Type, LINEAR);
    SO_NODE_DEFINE_ENUM_VALUE(Type, EXPONENTIAL);
    SO_NODE_DEFINE_ENUM_VALUE(Type, EXPONENTIAL_SQUARED);
    SO_NODE_DEFINE_ENUM_VALUE(Computed, PER_VERTEX);
    SO_NODE_DEFINE_ENUM_VALUE(Computed, PER_PIXEL);

    // Set up info in enumerated type fields
    SO_NODE_SET_SF_ENUM_TYPE(fogType, Type);
    SO_NODE_SET_SF_ENUM_TYPE(fogComputed, Computed);
}
SoXipImageOverlayManager::SoXipImageOverlayManager()
{
	SO_NODE_CONSTRUCTOR( SoXipImageOverlayManager );

	SO_NODE_ADD_FIELD( store, () );
	SO_NODE_ADD_FIELD( update, () );

	mShapeSwitch->whichChild.setValue(-1);
	mShapeSwitch->removeAllChildren();

	mImageData			= 0;
	mCurrentSlice		= -1;

	mStoreSensor = new SoFieldSensor( storeSensorCB, this );
	mStoreSensor->attach( &store );

	mUpdateSensor = new SoFieldSensor( updateSensorCB, this );
	mUpdateSensor->attach( &update );

	mOverlaysSensor = new SoNodeSensor( overlaysSensorCB, this );
	mOverlaysSensor->attach( mShapeSwitch );

	mOverlaysTimerSensor = new SoTimerSensor( overlaysTimerSensorCB, this );
	mOverlaysTimerSensor->unschedule();
}
Ejemplo n.º 5
0
SoOrthoSlice::SoOrthoSlice(void)
{
  SO_NODE_CONSTRUCTOR(SoOrthoSlice);

  PRIVATE(this) = new SoOrthoSliceP(this);

  SO_NODE_DEFINE_ENUM_VALUE(Axis, X);
  SO_NODE_DEFINE_ENUM_VALUE(Axis, Y);
  SO_NODE_DEFINE_ENUM_VALUE(Axis, Z);
  SO_NODE_SET_SF_ENUM_TYPE(axis, Axis);

  SO_NODE_DEFINE_ENUM_VALUE(Interpolation, NEAREST);
  SO_NODE_DEFINE_ENUM_VALUE(Interpolation, LINEAR);
  SO_NODE_SET_SF_ENUM_TYPE(interpolation, Interpolation);

  SO_NODE_DEFINE_ENUM_VALUE(AlphaUse, ALPHA_AS_IS);
  SO_NODE_DEFINE_ENUM_VALUE(AlphaUse, ALPHA_OPAQUE);
  SO_NODE_DEFINE_ENUM_VALUE(AlphaUse, ALPHA_BINARY);
  SO_NODE_SET_SF_ENUM_TYPE(alphaUse, AlphaUse);

  SO_NODE_DEFINE_ENUM_VALUE(ClippingSide, FRONT);
  SO_NODE_DEFINE_ENUM_VALUE(ClippingSide, BACK);
  SO_NODE_SET_SF_ENUM_TYPE(clippingSide, ClippingSide);

  SO_NODE_ADD_FIELD(sliceNumber, (0));
  SO_NODE_ADD_FIELD(axis, (Z));
  SO_NODE_ADD_FIELD(interpolation, (LINEAR));
  SO_NODE_ADD_FIELD(alphaUse, (ALPHA_BINARY));
  SO_NODE_ADD_FIELD(clippingSide, (BACK));
  SO_NODE_ADD_FIELD(clipping, (FALSE));

  // FIXME: implement proper support for alternateRep field. 20041008 mortene.
  SO_NODE_ADD_FIELD(alternateRep, (NULL));
}
Ejemplo n.º 6
0
SoXipMarkerSet::SoXipMarkerSet()
{
	SO_NODE_CONSTRUCTOR( SoXipMarkerSet );

	SO_NODE_DEFINE_ENUM_MARKER_VALUES( markerType );
	SO_NODE_SET_SF_ENUM_TYPE( marker, markerType );	
	SO_NODE_ADD_FIELD( marker, (0) );

	mCoord = new SoCoordinate3;
	if( mCoord )
		mCoord->ref();

	mFaceSet = new SoFaceSet;
	if( mFaceSet ) 
		mFaceSet->ref();

	mTranslation = new SoTranslation;
	if( mTranslation )
		mTranslation->ref();

	mScale = new SoScale;
	if( mScale ) 
		mScale->ref();

	mRotation = new SoRotation;
	if( mRotation ) 
		mRotation->ref();
}
Ejemplo n.º 7
0
SoV1WrapperKit::SoV1WrapperKit()
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoV1WrapperKit);

    if(SO_NODE_IS_FIRST_INSTANCE() ) {

    // Initialize children catalog and add entries to it
    // These are the macros you use to make a catalog.
    // Use ...INHERIT_CATALOG once, and put it first.
    // Then, use combinations of ...ADD_CATALOG_ENTRY 
    // and ...ADD_CATALOG_LIST_ENTRY.  See SoSubKit.h for more info
    // on syntax of these macros.
    SO_V1_SUBKIT_INHERIT_CATALOG(SoV1WrapperKit, SoV1GroupKit );
    SO_V1_SUBKIT_ADD_CATALOG_ENTRY("contents", SoSeparator,
				    "topSeparator", "childList", TRUE );

    }

    
    

    createNodekitPartsList();
}
SoXipGetCameraProperties::SoXipGetCameraProperties() {
	SO_NODE_CONSTRUCTOR(SoXipGetCameraProperties);

    SO_NODE_ADD_FIELD(camPos, (SbVec3f(0.0,0.0,0.0)));
	SO_NODE_ADD_FIELD(camDir, (SbVec3f(0.0,0.0,0.0)));
	SO_NODE_ADD_FIELD(viewport, (SbVec4f(0.0,0.0,0.0,0.0)));
}
Ejemplo n.º 9
0
SoXipMenuItem::SoXipMenuItem()
{
	SO_NODE_CONSTRUCTOR( SoXipMenuItem );	

	SO_XIP_KIT_ADD_TYPE_ENTRY( mVertices, SoVertexProperty, mSeparator );
	SO_XIP_KIT_ADD_TYPE_ENTRY( mFaces, SoIndexedFaceSet, mSeparator );

	SO_XIP_KIT_ADD_ENTRY( mIconOffset, SoTranslation, mSeparator );
	SO_XIP_KIT_ADD_ENTRY( mIconSwitch, SoSwitch, mSeparator );
	SO_XIP_KIT_ADD_ENTRY( mIconSeparator, SoSeparator, mIconSwitch );
	SO_XIP_KIT_ADD_ENTRY( mIconComplexity, SoComplexity, mIconSeparator );
	SO_XIP_KIT_ADD_TYPE_ENTRY( mIconTexture, SoXipIcon, mIconSeparator );
	SO_XIP_KIT_ADD_ENTRY( mIconTextCoords, SoTextureCoordinate2, mIconSeparator );
	SO_XIP_KIT_ADD_ENTRY( mIconCoords, SoVertexProperty, mIconSeparator );
	SO_XIP_KIT_ADD_ENTRY( mIconFaces, SoFaceSet, mIconSeparator );

	SO_XIP_KIT_ADD_ENTRY( mTextSeparator, SoSeparator, mSeparator );
	SO_XIP_KIT_ADD_ENTRY( mTextOffset, SoTranslation, mTextSeparator );
	SO_XIP_KIT_ADD_ENTRY( mTextMaterial, SoMaterial, mTextSeparator );
	SO_XIP_KIT_ADD_ENTRY( mText, SoXipText2, mTextSeparator );
	
	// Set the vertices for the item background
	mVertices->materialBinding.setValue( SoVertexProperty::PER_VERTEX_INDEXED );
	mVertices->orderedRGBA.setValues( 0, 9, s_defaultColors );
	mVertices->vertex.setValues( 0, 9, s_vertexCoords );

	// Set the face indices of the item background
	mFaces->coordIndex.setValues( 0, 32, s_faceIndices );	

	// Set the complexity of the icon texture to high
	mIconComplexity->set( "textureQuality 1" );

	((SoTextureCoordinate2 *) mIconTextCoords)->point.setValues( 0, 4, s_iconTextCoords );
	((SoVertexProperty*) mIconCoords)->vertex.setValues( 0, 4, s_iconCoords );
}
Ejemplo n.º 10
0
SoV1NurbsCurveKit::SoV1NurbsCurveKit()
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoV1NurbsCurveKit);

    if(SO_NODE_IS_FIRST_INSTANCE() ) {

    // Initialize children catalog and add entries to it
    // These are the macros you use to make a catalog.
    // Use ...INHERIT_CATALOG once, and put it first.
    // Then, use combinations of ...ADD_CATALOG_ENTRY 
    // and ...ADD_CATALOG_LIST_ENTRY.  See SoSubKit.h for more info
    // on syntax of these macros.
    SO_V1_SUBKIT_INHERIT_CATALOG(SoV1NurbsCurveKit, SoV1ShapeKit );
    SO_V1_SUBKIT_ADD_CATALOG_ENTRY("coordinate3", SoCoordinate3,
				    "topSeparator", "shape", TRUE );
    SO_V1_SUBKIT_ADD_CATALOG_ENTRY("coordinate4", SoCoordinate4,
				    "topSeparator", "shape", TRUE );
    SO_V1_SUBKIT_ADD_CATALOG_ENTRY("textureCoordinate2", SoTextureCoordinate2,
				    "topSeparator", "shape", TRUE );
    SO_V1_SUBKIT_CHANGE_ENTRY_TYPE("shape", SoNurbsCurve, SoNurbsCurve );

    }

    
    

    createNodekitPartsList();
}
Ejemplo n.º 11
0
/*!
  Constructor.
*/
SoSceneTextureCubeMap::SoSceneTextureCubeMap(void)
{
  PRIVATE(this) = new SoSceneTextureCubeMapP(this);

  SO_NODE_CONSTRUCTOR(SoSceneTextureCubeMap);

  SO_NODE_ADD_FIELD(size, (256, 256));
  SO_NODE_ADD_FIELD(scene, (NULL));
  SO_NODE_ADD_FIELD(backgroundColor, (0.0f, 0.0f, 0.0f));
  SO_NODE_ADD_FIELD(transparencyFunction, (NONE));

  SO_NODE_ADD_FIELD(wrapS, (REPEAT));
  SO_NODE_ADD_FIELD(wrapT, (REPEAT));
  SO_NODE_ADD_FIELD(wrapR, (REPEAT));
  SO_NODE_ADD_FIELD(model, (MODULATE));
  SO_NODE_ADD_FIELD(blendColor, (0.0f, 0.0f, 0.0f));

  SO_NODE_DEFINE_ENUM_VALUE(Wrap, REPEAT);
  SO_NODE_DEFINE_ENUM_VALUE(Wrap, CLAMP);

  SO_NODE_SET_SF_ENUM_TYPE(wrapS, Wrap);
  SO_NODE_SET_SF_ENUM_TYPE(wrapT, Wrap);
  SO_NODE_SET_SF_ENUM_TYPE(wrapR, Wrap);

  SO_NODE_DEFINE_ENUM_VALUE(Model, MODULATE);
  SO_NODE_DEFINE_ENUM_VALUE(Model, DECAL);
  SO_NODE_DEFINE_ENUM_VALUE(Model, BLEND);
  SO_NODE_DEFINE_ENUM_VALUE(Model, REPLACE);
  SO_NODE_SET_SF_ENUM_TYPE(model, Model);

  SO_NODE_DEFINE_ENUM_VALUE(TransparencyFunction, NONE);
  SO_NODE_DEFINE_ENUM_VALUE(TransparencyFunction, ALPHA_BLEND);
  SO_NODE_DEFINE_ENUM_VALUE(TransparencyFunction, ALPHA_TEST);
  SO_NODE_SET_SF_ENUM_TYPE(transparencyFunction, TransparencyFunction);
}
Ejemplo n.º 12
0
SoXipOverlayManips::SoXipOverlayManips()
{
	SO_NODE_CONSTRUCTOR( SoXipOverlayManips );

	SO_NODE_ADD_FIELD( numNodesUpToContainer, (2) );
	SO_NODE_ADD_FIELD( multipleSelection, (FALSE) );
	SO_NODE_ADD_FIELD( enableSelection,	  (TRUE)  );

	// Main separator
	SO_XIP_KIT_ADD_ENTRY( mTopSeparator, SoSeparator, this );

	// Manipulators
	SO_XIP_KIT_ADD_ENTRY( mHandlerManip, SoXipOverlayHandlerManip, this );
	SO_XIP_KIT_ADD_ENTRY( mTransformBox, SoXipOverlayTransformBoxManip, this );
	SO_XIP_KIT_ADD_ENTRY( mSelectionManip, SoXipOverlaySelectionManip, this );
	SO_XIP_KIT_ADD_ENTRY( mTranslationManip, SoXipOverlayTranslationManip, this );
	SO_XIP_KIT_ADD_ENTRY( mSelectionFrame, SoXipOverlaySelectionFrame, this );

	((SoXipOverlayManipBase *) mHandlerManip)->numNodesUpToContainer.connectFrom( &numNodesUpToContainer );
	((SoXipOverlayManipBase *) mHandlerManip)->on.connectFrom( &enableSelection );
	((SoXipOverlayManipBase *) mSelectionManip)->numNodesUpToContainer.connectFrom( &numNodesUpToContainer );
    ((SoXipOverlayManipBase *) mSelectionManip)->on.connectFrom( &enableSelection );
	((SoXipOverlayManipBase *) mSelectionFrame)->numNodesUpToContainer.connectFrom( &numNodesUpToContainer );
	((SoXipOverlayManipBase *) mSelectionFrame)->on.connectFrom( &multipleSelection );
	((SoXipOverlayManipBase *) mTransformBox)->numNodesUpToContainer.connectFrom( &numNodesUpToContainer );
	((SoXipOverlayManipBase *) mTransformBox)->on.connectFrom( &enableSelection );
	((SoXipOverlayManipBase *) mTranslationManip)->numNodesUpToContainer.connectFrom( &numNodesUpToContainer );
	((SoXipOverlayManipBase *) mTranslationManip)->on.connectFrom( &enableSelection ); 
}
//!  Constructor
SoUMDViewerTrigger::SoUMDViewerTrigger()
{
    // Execute inventor internal stuff for node construction.
    SO_NODE_CONSTRUCTOR(SoUMDViewerTrigger);

    //SO_NODE_ADD_FIELD(ViewerNameFld, ("UndefindedName"));
    SO_NODE_ADD_FIELD(StatusFld, ("Ready"));
    //SO_NODE_ADD_FIELD(PongFld, ("Ready"));
    //SO_NODE_ADD_FIELD(PositionFld, (0,0,0));
    //SO_NODE_ADD_FIELD(OrientationFld, (0,0,0,0));
    //SO_NODE_ADD_FIELD(ForceRedrawFld, ());


    timerSensor = new SoTimerSensor((SoSensorCB*)SoUMDViewerTrigger::timerEvent, this);
    timerSensor->setInterval(SbTime(1.0/50.0));
    //timerSensor->setInterval(SbTime(1.0/1.0)); //!!!!ACHTUNG NUR ZUM VERLANGSAMEN FÜR EUROVISPAPER
    timerSensor->unschedule();

    currentlyLeft = false;
    frameRendered = true;


    // Create a sensor calling nodeChangedCB if any field changes.
    //_nodeSensor = new SoNodeSensor((SoSensorCB*)SoUMDViewerTrigger::_nodeChangedCB, this);
    //_nodeSensor->attach(this);

    // Set priority of sensor. Priority 0 forces direct call which is needed for correct field detection.
    //_nodeSensor->setPriority(0);

}
SoXipMenuItemSeparator::SoXipMenuItemSeparator()
{
	SO_NODE_CONSTRUCTOR( SoXipMenuItemSeparator );

	SO_XIP_KIT_ADD_ENTRY( mFaceSeparator,      SoSeparator, mSeparator );
	SO_XIP_KIT_ADD_TYPE_ENTRY( mVertices, SoVertexProperty, mFaceSeparator );
	SO_XIP_KIT_ADD_TYPE_ENTRY(    mFaces, SoIndexedFaceSet, mFaceSeparator );

	SO_XIP_KIT_ADD_ENTRY(   mLineSeparator,   SoSeparator, mSeparator );
	SO_XIP_KIT_ADD_ENTRY(    mLineMaterial,    SoMaterial, mLineSeparator );
	SO_XIP_KIT_ADD_ENTRY(       mLineStyle,   SoDrawStyle, mLineSeparator );
	SO_XIP_KIT_ADD_TYPE_ENTRY( mLineCoords, SoCoordinate3, mLineSeparator );
	SO_XIP_KIT_ADD_ENTRY(         mLineSet,     SoLineSet, mLineSeparator );

	mVertices->materialBinding.setValue( SoVertexProperty::PER_VERTEX_INDEXED );
	mVertices->vertex.setNum(4);
	mVertices->vertex.setValues( 0, 4, s_faceCoords );
	mVertices->orderedRGBA.setValues( 0, 4, s_vertexColors );
	
	mFaces->coordIndex.setValues( 0, 8, s_faceIndices );
	mLineCoords->point.setValues( 0, 2, s_lineCoords );

	mLineMaterial->set( "diffuseColor 0.5 0.5 0.5" );
	mLineStyle->set( "lineWidth 1" );
}
Ejemplo n.º 15
0
SoV2Text3::SoV2Text3()
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoV2Text3);

    SO_NODE_ADD_FIELD(string,	(""));
    SO_NODE_ADD_FIELD(spacing,	(1.0));
    SO_NODE_ADD_FIELD(justification,	(LEFT));
    SO_NODE_ADD_FIELD(parts,		(FRONT));

    // Set up static info for enumerated type field
    SO_NODE_DEFINE_ENUM_VALUE(Justification,	LEFT);
    SO_NODE_DEFINE_ENUM_VALUE(Justification,	RIGHT);
    SO_NODE_DEFINE_ENUM_VALUE(Justification,	CENTER);

    // Set up static info for enumerated type field
    SO_NODE_DEFINE_ENUM_VALUE(Part, SIDES);
    SO_NODE_DEFINE_ENUM_VALUE(Part, FRONT);
    SO_NODE_DEFINE_ENUM_VALUE(Part, BACK);
    SO_NODE_DEFINE_ENUM_VALUE(Part, ALL);

    // Set up info in enumerated type field
    SO_NODE_SET_SF_ENUM_TYPE(justification, Justification);
    SO_NODE_SET_SF_ENUM_TYPE(parts, Part);
    
    isBuiltIn = TRUE;
}
Ejemplo n.º 16
0
/*!
  Constructor.
*/
SmTextureText2::SmTextureText2()
{
  SO_NODE_CONSTRUCTOR(SmTextureText2);

  SO_NODE_ADD_FIELD(string, (""));
  SO_NODE_ADD_FIELD(justification, (LEFT));
  SO_NODE_ADD_FIELD(verticalJustification, (BOTTOM));
  SO_NODE_ADD_FIELD(maxRange, (-1.0f));
  SO_NODE_ADD_FIELD(position, (0.0f, 0.0f, 0.0f));
  SO_NODE_ADD_FIELD(offset, (0.0f, 0.0f, 0.0f));
  SO_NODE_ADD_FIELD(rotation, (0.0f)); // TODO also make it work for SmTextureText2Collector
  SO_NODE_ADD_FIELD(pickOnPixel, (FALSE));
  SO_NODE_ADD_EMPTY_MFIELD(stringIndex);

  SO_NODE_DEFINE_ENUM_VALUE(Justification, CENTER);
  SO_NODE_DEFINE_ENUM_VALUE(Justification, LEFT);
  SO_NODE_DEFINE_ENUM_VALUE(Justification, RIGHT);

  SO_NODE_DEFINE_ENUM_VALUE(VerticalJustification, TOP);
  SO_NODE_DEFINE_ENUM_VALUE(VerticalJustification, BOTTOM);
  SO_NODE_DEFINE_ENUM_VALUE(VerticalJustification, VCENTER);

  SO_NODE_SET_SF_ENUM_TYPE(justification, Justification);
  SO_NODE_SET_SF_ENUM_TYPE(verticalJustification, VerticalJustification);
}
Ejemplo n.º 17
0
SoXipBlendFunc::SoXipBlendFunc()
{
	SO_NODE_CONSTRUCTOR(SoXipBlendFunc);

	SO_NODE_ADD_FIELD(enableBlending, (true));

	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ZERO);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ONE);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, SRC_COLOR);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, DST_COLOR);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, SRC_ALPHA);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, DST_ALPHA);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ONE_MINUS_SRC_COLOR);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ONE_MINUS_DST_COLOR);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ONE_MINUS_SRC_ALPHA);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ONE_MINUS_DST_ALPHA);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, CONSTANT_COLOR);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, CONSTANT_ALPHA);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ONE_MINUS_CONSTANT_COLOR);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, ONE_MINUS_CONSTANT_ALPHA);
	SO_NODE_DEFINE_ENUM_VALUE(BlendFactor, SRC_ALPHA_SATURATE);
	SO_NODE_SET_SF_ENUM_TYPE(srcFunc, BlendFactor);
	SO_NODE_SET_SF_ENUM_TYPE(dstFunc, BlendFactor);

	SO_NODE_ADD_FIELD(srcFunc, (SRC_ALPHA));
	SO_NODE_ADD_FIELD(dstFunc, (ONE_MINUS_SRC_ALPHA));
}
Ejemplo n.º 18
0
SoColorShape::SoColorShape() {
   SO_NODE_CONSTRUCTOR(SoColorShape);

   SO_NODE_ADD_FIELD(input, (0));

   _extentX = _extentY = _extentZ = 0;
   _vertexPropArray = 0;
   _sizeCoordinate3 = 0;

   // Callback zum einsammeln der Koordinaten
   _myAction = new SoCallbackAction;
   _myAction->addPreCallback        (SoShape::getClassTypeId(), preCB, this);
   _myAction->addTriangleCallback   (SoShape::getClassTypeId(), triangleCB, this);

   //sensor = new SoFieldSensor(sensorCB, this);
   //sensor->attach(&input);

   _nearDistance = 2.0f;
   _farDistance = 5.0f;

   float temp = 0;
   _nearDistanceColor.setPackedValue(0xFF0000FF, temp);
   _farDistanceColor.setPackedValue(0xFFFF00FF, temp);

   _vertexSet = 0;
   _edgeSet = 0;
   _triangleSet = 0;
}
Ejemplo n.º 19
0
SoXipDrawClipPlane::SoXipDrawClipPlane() {
	SO_NODE_CONSTRUCTOR(SoXipDrawClipPlane);

	SO_NODE_ADD_FIELD(plane, (SbPlane(SbVec3f(0, 0, 1), 0)));
  	SO_NODE_ADD_FIELD(on, (TRUE));
	SO_NODE_ADD_FIELD(boundingBox, (SbMatrix::identity()));
}
Ejemplo n.º 20
0
SoXipMenuItemBase::SoXipMenuItemBase()
{
	SO_NODE_CONSTRUCTOR( SoXipMenuItemBase );

	SO_XIP_KIT_ADD_TYPE_ENTRY(     mSeparator, SoSeparator, this );
	SO_XIP_KIT_ADD_TYPE_ENTRY( mSubMenuSwitch,    SoSwitch, mSeparator );

	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_NONE );
	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_COPY );
	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_CUT );
	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_PASTE );

	SO_NODE_SET_SF_ENUM_TYPE( icon, IconType );	

	SO_NODE_ADD_FIELD( focused, (FALSE) );
	SO_NODE_ADD_FIELD( enabled, (TRUE) );
	SO_NODE_ADD_FIELD( caption, ("") );
	SO_NODE_ADD_FIELD(    icon, (IC_NONE) );
	
	SoField* fields[] = { &focused, &enabled, &caption, &icon };
	
	int numFieldSensors = 4;
    for( int i = 0; i < numFieldSensors; ++ i )
    {
        mFieldSensors[i] = new SoFieldSensor( fieldSensorCB, this );
		mFieldSensors[i]->attach( fields[i] );        
    }
}
Ejemplo n.º 21
0
SoV1ConeKit::SoV1ConeKit()
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoV1ConeKit);

    if(SO_NODE_IS_FIRST_INSTANCE() ) {
    // Initialize children catalog and add entries to it
    // These are the macros you use to make a catalog.
    // Use ...INHERIT_CATALOG once, and put it first.
    // Then, use combinations of ...ADD_CATALOG_ENTRY 
    // and ...ADD_CATALOG_LIST_ENTRY.  See SoSubKit.h for more info
    // on syntax of these macros.
    SO_V1_SUBKIT_INHERIT_CATALOG(SoV1ConeKit, SoV1ShapeKit );
    SO_V1_SUBKIT_CHANGE_ENTRY_TYPE("shape", SoCone, SoCone );

    }

    
    

    createNodekitPartsList();
    if ( getNodekitCatalog() != NULL ) {
	SoCone *myCone = new SoCone;
	setAnyPart( "shape", myCone, TRUE );
    }
}
Ejemplo n.º 22
0
SoXipIcon::SoXipIcon()
{
	SO_NODE_CONSTRUCTOR( SoXipIcon );

	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_NONE );
	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_COPY );
	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_CUT );
	SO_NODE_DEFINE_ENUM_VALUE( IconType, IC_PASTE );

	SO_NODE_SET_SF_ENUM_TYPE( icon, IconType );	

	SO_NODE_ADD_FIELD(             icon, (IC_NONE) );
	SO_NODE_ADD_FIELD(    isTransparent, (FALSE) );
	SO_NODE_ADD_FIELD( transparentColor, (0, 0, 0) );

	mTexture = new SoTexture2;
	mTexture->ref();

	mFieldSensors[0] = new SoFieldSensor( fieldSensorsCB, this );
	mFieldSensors[0]->attach( &icon );
	mFieldSensors[1] = new SoFieldSensor( fieldSensorsCB, this );
	mFieldSensors[1]->attach( &isTransparent );
	mFieldSensors[2] = new SoFieldSensor( fieldSensorsCB, this );
	mFieldSensors[2]->attach( &transparentColor );
}
SoTextureCoordinateEnvironment::SoTextureCoordinateEnvironment()
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoTextureCoordinateEnvironment);
    isBuiltIn = TRUE;
}
Ejemplo n.º 24
0
/**
 *  Constructor.
 */
SoXipBindTextures::SoXipBindTextures()
{
    SO_NODE_CONSTRUCTOR(SoXipBindTextures);

	SO_NODE_DEFINE_ENUM_VALUE(TextureDimension, TEXTURE_1D);
	SO_NODE_DEFINE_ENUM_VALUE(TextureDimension, TEXTURE_2D);
	SO_NODE_DEFINE_ENUM_VALUE(TextureDimension, TEXTURE_3D);
	SO_NODE_SET_SF_ENUM_TYPE(textureDimension, TextureDimension);

    // add input fields
    SO_NODE_ADD_FIELD(textureDimension,  (TEXTURE_2D));
    SO_NODE_ADD_FIELD(attachmentHandles, (0));

    // add output fields
    SO_NODE_ADD_FIELD(texture0Output, (-1));
    SO_NODE_ADD_FIELD(texture1Output, (-1));
    SO_NODE_ADD_FIELD(texture2Output, (-1));
    SO_NODE_ADD_FIELD(texture3Output, (-1));
    SO_NODE_ADD_FIELD(texture4Output, (-1));
    SO_NODE_ADD_FIELD(texture5Output, (-1));
    SO_NODE_ADD_FIELD(texture6Output, (-1));
    SO_NODE_ADD_FIELD(texture7Output, (-1));

    //attachmentHandles.deleteValues(0);
    mNumTextures = attachmentHandles.getNum();

    for (int i = 0; i < 16; i++) {
        mTexHandles[i] = 0;
        mTexUnits[i] = 0;
    }

    mNodeId = 0;
    mNeedsSync = true;
}
TransmissivityATMParameters::TransmissivityATMParameters( )
{
	SO_NODE_CONSTRUCTOR( TransmissivityATMParameters );
	SO_NODE_ADD_FIELD( atm1, ( 0.29544 ) );
	SO_NODE_ADD_FIELD( atm2, ( 15.22128 ) );
	SO_NODE_ADD_FIELD( atm3, ( -1.8598 ) );
	SO_NODE_ADD_FIELD( atm4, ( 0.15182 ) );
}
Ejemplo n.º 26
0
SoBillboard::SoBillboard()
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoBillboard);
    SO_NODE_ADD_FIELD(axis, (0.0, 0.0, 0.0));
    //isBuiltIn = TRUE;
}
Ejemplo n.º 27
0
SoShaderParameterMatrixArray::SoShaderParameterMatrixArray(void)
{
  SO_NODE_CONSTRUCTOR(SoShaderParameterMatrixArray);
  SO_NODE_ADD_FIELD(value, (SbMatrix(1,0,0,0,
                                     0,1,0,0,
                                     0,0,1,0,
                                     0,0,0,1)));
}
Ejemplo n.º 28
0
SoSwitch::SoSwitch(int nChildren) : SoGroup(nChildren)
//
////////////////////////////////////////////////////////////////////////
{
    SO_NODE_CONSTRUCTOR(SoSwitch);
    SO_NODE_ADD_FIELD(whichChild, (SO_SWITCH_NONE));
    isBuiltIn = TRUE;
}
Ejemplo n.º 29
0
MaterialBasicRefractive::MaterialBasicRefractive()
{
	SO_NODE_CONSTRUCTOR( MaterialBasicRefractive );
	SO_NODE_ADD_FIELD( reflectivityFront, (0.0) );
	SO_NODE_ADD_FIELD( reflectivityBack, (0.0) );
	SO_NODE_ADD_FIELD( transmissivityFront, (0.0) );
	SO_NODE_ADD_FIELD( transmissivityBack, (0.0) );
	SO_NODE_ADD_FIELD( nFront, (0.0) );
	SO_NODE_ADD_FIELD( nBack, (0.0) );
	SO_NODE_ADD_FIELD( sigmaSlope, (2.0) );
	//SO_NODE_ADD_FIELD( m_sigmaSpecularity, (0.5) );

	SO_NODE_DEFINE_ENUM_VALUE(Distribution, PILLBOX);
  	SO_NODE_DEFINE_ENUM_VALUE(Distribution, NORMAL);
  	SO_NODE_SET_SF_ENUM_TYPE( distribution, Distribution);
	SO_NODE_ADD_FIELD( distribution, (PILLBOX) );

	SO_NODE_ADD_FIELD( m_ambientColor, (0.2f, 0.2f, 0.2f) );
	SO_NODE_ADD_FIELD( m_diffuseColor, (0.8f, 0.8f, 0.8f) );
	SO_NODE_ADD_FIELD( m_specularColor, (0.0f, 0.0f, 0.0f) );
	SO_NODE_ADD_FIELD( m_emissiveColor, (0.0f, 0.0f, 0.0f) );
	SO_NODE_ADD_FIELD( m_shininess, (0.2f) );
	SO_NODE_ADD_FIELD( m_transparency, (0.0) );

	SoFieldSensor* reflectivityFrontSensor = new SoFieldSensor( updateReflectivityFront, this );
	reflectivityFrontSensor->setPriority( 1 );
	reflectivityFrontSensor->attach( &reflectivityFront );
	SoFieldSensor* transmissivityFrontSensor = new SoFieldSensor( updateTransmissivityFront, this );
	transmissivityFrontSensor->setPriority( 1 );
	transmissivityFrontSensor->attach( &transmissivityFront );

	SoFieldSensor* reflectivityBackSensor = new SoFieldSensor( updateReflectivityBack, this );
	reflectivityBackSensor->setPriority( 1 );
	reflectivityBackSensor->attach( &reflectivityBack );
	SoFieldSensor* transmissivityBackSensor = new SoFieldSensor( updateTransmissivityBack, this );
	transmissivityBackSensor->setPriority( 1 );
	transmissivityBackSensor->attach( &transmissivityBack );

	SoFieldSensor* m_ambientColorSensor = new SoFieldSensor( updateAmbientColor, this );
	m_ambientColorSensor->setPriority( 1 );
	m_ambientColorSensor->attach( &m_ambientColor );
	SoFieldSensor* m_diffuseColorSensor = new SoFieldSensor( updateDiffuseColor, this );
	m_diffuseColorSensor->setPriority( 1 );
	m_diffuseColorSensor->attach( &m_diffuseColor );
	SoFieldSensor* m_specularColorSensor = new SoFieldSensor( updateSpecularColor, this );
	m_specularColorSensor->setPriority( 1 );
	m_specularColorSensor->attach( &m_specularColor );
	SoFieldSensor* m_emissiveColorSensor = new SoFieldSensor( updateEmissiveColor, this );
	m_emissiveColorSensor->setPriority( 1 );
	m_emissiveColorSensor->attach( &m_emissiveColor );
	SoFieldSensor* m_shininessSensor = new SoFieldSensor( updateShininess, this );
	m_shininessSensor->setPriority( 1 );
	m_shininessSensor->attach( &m_shininess );
	SoFieldSensor* m_transparencySensor = new SoFieldSensor( updateTransparency, this );
	m_transparencySensor->setPriority( 1 );
	m_transparencySensor->attach( &m_transparency );
}
// --------------------------------------------------------------------------
//! Constructor, creates fields
// --------------------------------------------------------------------------
SoFramesPerSecond::SoFramesPerSecond()
{
   // Execute inventor internal stuff for node construction.
   SO_NODE_CONSTRUCTOR(SoFramesPerSecond);

   SO_NODE_ADD_FIELD(fps, (0));

   _lastSnapShot = 0.0;
}