Exemplo n.º 1
0
SoAction::SoAction() : curPath(32)
//
////////////////////////////////////////////////////////////////////////
{
    SO_ACTION_CONSTRUCTOR(SoAction);

#ifdef DEBUG
    if (! SoDB::isInitialized())
	SoDebugError::post("SoAction::SoAction",
			   "Cannot construct actions before "
			   "calling SoDB::init()");
#endif /* DEBUG */

    isBeingApplied	= FALSE;
    appliedTo.node	= NULL;
    appliedTo.path	= NULL;
    appliedTo.pathList	= NULL;
    state		= NULL;
    terminated		= FALSE;
    tempPath		= NULL;

    // Make sure enabled elements list is set up the first time this
    // is applied.
    enabledElementsCounter = -1;

}
/*!
  Constructor, taking an explicit \a viewportregion to render.
*/
SoLineHighlightRenderAction::SoLineHighlightRenderAction(const SbViewportRegion & viewportregion)
  : inherited(viewportregion)
{
  PRIVATE(this)->owner = this;
  // need to set hlVisible here, and not in the pimpl constructor, since
  // "owner" is not initialized when the pimpl constructor is called
  this->hlVisible = TRUE;
  SO_ACTION_CONSTRUCTOR(SoLineHighlightRenderAction);
}
Exemplo n.º 3
0
SoWriteAction::SoWriteAction()
//
////////////////////////////////////////////////////////////////////////
{
    SO_ACTION_CONSTRUCTOR(SoWriteAction);
    output = new SoOutput;
    createdOutput = TRUE;
    continuing    = FALSE;
    doOneStage    = FALSE;
}
Exemplo n.º 4
0
//////////////////////////////////////////////////////////////////////////////
//
//  Constructor common
//
void
SoBoxHighlightRenderAction::constructorCommon()
//
//////////////////////////////////////////////////////////////////////////////
{
    SO_ACTION_CONSTRUCTOR(SoBoxHighlightRenderAction);

    // Set up our highlight graph
    localRoot   = new SoSeparator;
    lightModel	= new SoLightModel;
    baseColor	= new SoBaseColor;
    drawStyle	= new SoDrawStyle;
    texture	= new SoTexture2;
    xform	= new SoMatrixTransform;
    xlate	= new SoTranslation;
    cube	= new SoCube;
    SoMaterialBinding *mb = new SoMaterialBinding;
    
    SoComplexity *complexity = new SoComplexity;    
    complexity->value = 0.0;
    complexity->setOverride(TRUE);

    localRoot->ref();
    
    lightModel->model = SoLightModel::BASE_COLOR;
    lightModel->setOverride(TRUE);

    baseColor->rgb.setValue(1, 0, 0); // default color
    baseColor->setOverride(TRUE);

    drawStyle->style = SoDrawStyle::LINES;
    drawStyle->lineWidth = 3;
    drawStyle->linePattern = 0xffff;
    drawStyle->setOverride(TRUE);
    
    // turn off texturing
    texture->setOverride(TRUE);
    
    // set material binding to OVERALL:
    mb->setOverride(TRUE);
    
    // now set up the highlight graph
    localRoot->addChild(lightModel);
    localRoot->addChild(baseColor);
    localRoot->addChild(drawStyle);
    localRoot->addChild(texture);
    localRoot->addChild(complexity);
    localRoot->addChild(xform);
    localRoot->addChild(xlate);
    localRoot->addChild(cube);
    localRoot->addChild(mb);
    
    hlVisible = TRUE;
    selPath = NULL;
}    
Exemplo n.º 5
0
//////////////////////////////////////////////////////////////////////////////
//
//  Constructor common
//
void
SoLineHighlightRenderAction::constructorCommon()
//
//////////////////////////////////////////////////////////////////////////////
{
    SO_ACTION_CONSTRUCTOR(SoLineHighlightRenderAction);

    // Set up our highlight graph
    localRoot   = new SoSeparator;
    lightModel	= new SoLightModel;
    baseColor	= new SoBaseColor;
    drawStyle	= new SoDrawStyle;
    texture	= new SoTexture2;
    SoMaterialBinding *mb = new SoMaterialBinding;

    localRoot->ref();
    
    lightModel->model = SoLightModel::BASE_COLOR;
    lightModel->setOverride(TRUE);

    baseColor->rgb.setValue(1, 0, 0); // default color
    baseColor->setOverride(TRUE);

    drawStyle->style = SoDrawStyle::LINES;
    drawStyle->lineWidth = 3;
    drawStyle->linePattern = 0xffff;
    drawStyle->setOverride(TRUE);
    
    // turn off texturing
    texture->setOverride(TRUE);
    
    //set material binding to OVERALL
    mb->setOverride(TRUE);
    
    // now set up the highlight graph
    localRoot->addChild(lightModel);
    localRoot->addChild(baseColor);
    localRoot->addChild(drawStyle);
    localRoot->addChild(texture);
    localRoot->addChild(mb);
    
    hlVisible = TRUE;
}    
Exemplo n.º 6
0
//
// private. called by both constructors
//
void
SoBoxHighlightRenderAction::init(void)
{
  SO_ACTION_CONSTRUCTOR(SoBoxHighlightRenderAction);

  PRIVATE(this)->master = this;

  // Initialize local variables
  PRIVATE(this)->initBoxGraph();

  this->hlVisible = TRUE;

  PRIVATE(this)->basecolor->rgb.setValue(1.0f, 0.0f, 0.0f);
  PRIVATE(this)->drawstyle->linePattern = 0xffff;
  PRIVATE(this)->drawstyle->lineWidth = 3.0f;
  PRIVATE(this)->searchaction = NULL;
  PRIVATE(this)->camerasearch = NULL;
  PRIVATE(this)->bboxaction = NULL;

  // SoBase-derived objects should be dynamically allocated.
  PRIVATE(this)->postprocpath = new SoTempPath(32);
  PRIVATE(this)->postprocpath->ref();
}