//cout << "SetPointSpriteResults " << this << " " << aResults << endl;
this->PointSpriteResults = theResults;
-#ifdef GL_ARB_shader_objects
- this->SetShaderVariable( "results", aResults );
-#endif
+ //#ifdef GL_ARB_shader_objects
+ //this->SetShaderVariable( "results", theMagnification );
+ //#endif
this->Modified();
}
//-----------------------------------------------------------------------------
void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp( float theClamp )
{
this->PointSpriteClamp = theClamp;
-#ifdef GL_ARB_shader_objects
- this->SetShaderVariable( "clamp", theClamp );
-#endif
this->Modified();
}
//-----------------------------------------------------------------------------
void VISU_OpenGLPointSpriteMapper::SetPointSpriteSize( float theSize )
{
this->PointSpriteSize = theSize;
-#ifdef GL_ARB_shader_objects
- this->SetShaderVariable( "geomSize", theSize );
-#endif
this->Modified();
}
//-----------------------------------------------------------------------------
void VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize( float theMinSize )
{
this->PointSpriteMinSize = theMinSize;
-#ifdef GL_ARB_shader_objects
- this->SetShaderVariable( "minSize", theMinSize );
-#endif
this->Modified();
}
//-----------------------------------------------------------------------------
void VISU_OpenGLPointSpriteMapper::SetPointSpriteMaxSize( float theMaxSize )
{
this->PointSpriteMaxSize = theMaxSize;
-#ifdef GL_ARB_shader_objects
- this->SetShaderVariable( "maxSize", theMaxSize );
-#endif
this->Modified();
}
//-----------------------------------------------------------------------------
void VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification( float theMagnification )
{
this->PointSpriteMagnification = theMagnification;
-#ifdef GL_ARB_shader_objects
- this->SetShaderVariable( "magnification", theMagnification );
-#endif
this->Modified();
}
//-----------------------------------------------------------------------------
//PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB =
// (PFNGLUSEPROGRAMOBJECTARBPROC)dlsym( this->OpenGLLibrary, "glUseProgramObjectARB" );
//glUseProgramObjectARB( VISU_OpenGLPointSpriteMapper::VertexProgram );
-
+ /*
this->SetShaderVariable( "attrib1", 1.0 );
this->SetShaderVariable( "attrib2", 1.0 );
this->SetShaderVariable( "attrib3", 1.0 );
this->SetShaderVariable( "minSize", this->PointSpriteMinSize );
this->SetShaderVariable( "maxSize", this->PointSpriteMaxSize );
this->SetShaderVariable( "magnification", this->PointSpriteMagnification );
+ */
}
#endif
glPointSize( this->DefaultPointSize );
#ifdef GL_ARB_vertex_buffer_object
- PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB =
- (PFNGLUSEPROGRAMOBJECTARBPROC)dlsym( this->OpenGLLibrary, "glUseProgramObjectARB" );
PFNGLGENBUFFERSARBPROC glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)dlsym( this->OpenGLLibrary, "glGenBuffersARB" );
PFNGLBINDBUFFERARBPROC glBindBufferARB = (PFNGLBINDBUFFERARBPROC)dlsym( this->OpenGLLibrary, "glBindBufferARB" );
PFNGLBUFFERDATAARBPROC glBufferDataARB = (PFNGLBUFFERDATAARBPROC)dlsym( this->OpenGLLibrary, "glBufferDataARB" );
+#ifdef GL_ARB_shader_objects
+ PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB =
+ (PFNGLUSEPROGRAMOBJECTARBPROC)dlsym( this->OpenGLLibrary, "glUseProgramObjectARB" );
+
glUseProgramObjectARB( myVertexProgram );
+ this->SetShaderVariable( "attrib1", 0.0 );
+ this->SetShaderVariable( "attrib2", 0.0 );
+ this->SetShaderVariable( "attrib3", 0.0 );
+ this->SetShaderVariable( "results", this->PointSpriteResults );
+ this->SetShaderVariable( "clamp", this->PointSpriteClamp );
+ this->SetShaderVariable( "geomSize", this->PointSpriteSize );
+ this->SetShaderVariable( "attrib4", 0.0 );
+ this->SetShaderVariable( "minSize", this->PointSpriteMinSize );
+ this->SetShaderVariable( "maxSize", this->PointSpriteMaxSize );
+ this->SetShaderVariable( "magnification", this->PointSpriteMagnification );
+#endif
+
TVertex* aVertex = new TVertex[ this->TotalCells ];
vtkIdType *pts = 0;
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
+#ifdef GL_ARB_shader_objects
glUseProgramObjectARB( 0 );
+#endif
+
#endif
if( this->UsePointSprites )
VISU::GaussPoints_i
::UpdateActor(VISU_Actor* theActor)
{
- TSuperClass::UpdateActor(theActor);
if(VISU_GaussPtsAct* anActor = dynamic_cast<VISU_GaussPtsAct*>(theActor)){
if(GetIsColored()){
anActor->SetBarVisibility(true);
myPipeLine->GetMapper()->SetScalarVisibility(1);
- }
- else{
- anActor->SetBarVisibility(false);
- myPipeLine->GetMapper()->SetScalarVisibility(0);
- anActor->GetProperty()->SetColor(myColor.red() / 255.0,
- myColor.green() / 255.0,
- myColor.blue() / 255.0);
- }
- if(VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl()){
- vtkIdType aScalarMode = GetScalarMode();
- TMinMax aTMinMax = myField->GetMinMax(aScalarMode);
- float *aRange = myScalarMapPL->GetBarTable()->GetRange();
+ if(VISU_ScalarBarCtrl *aScalarBarCtrl = anActor->GetScalarBarCtrl()){
+ vtkIdType aScalarMode = GetScalarMode();
+ TMinMax aTMinMax = myField->GetMinMax(aScalarMode);
+ float *aRange = myScalarMapPL->GetBarTable()->GetRange();
- aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
- aScalarBarCtrl->SetRangeLocal(aRange);
+ aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
+ aScalarBarCtrl->SetRangeLocal(aRange);
- aScalarBarCtrl->SetOrientation(myOrientation);
+ aScalarBarCtrl->SetOrientation(myOrientation);
- int aScalarBarMode;
- if(myIsActiveLocalScalarBar){
- aScalarBarMode = 2;
- }
- else{
- if(myIsDispGlobalScalarBar){
- aScalarBarMode = 1;
+ int aScalarBarMode;
+ if(myIsActiveLocalScalarBar){
+ aScalarBarMode = 2;
}
else{
- aScalarBarMode = 0;
- aScalarBarCtrl->SetRangeGlobal(aRange);
+ if(myIsDispGlobalScalarBar){
+ aScalarBarMode = 1;
+ }
+ else{
+ aScalarBarMode = 0;
+ aScalarBarCtrl->SetRangeGlobal(aRange);
+ }
}
- }
- aScalarBarCtrl->SetMode(aScalarBarMode);
+ aScalarBarCtrl->SetMode(aScalarBarMode);
- // Position
- aScalarBarCtrl->SetWidth(myWidth);
- aScalarBarCtrl->SetHeight(myHeight);
- aScalarBarCtrl->SetPosition(myPosition);
+ // Position
+ aScalarBarCtrl->SetWidth(myWidth);
+ aScalarBarCtrl->SetHeight(myHeight);
+ aScalarBarCtrl->SetPosition(myPosition);
- aScalarBarCtrl->SetSpacing(mySpacing);
+ aScalarBarCtrl->SetSpacing(mySpacing);
- // Bicolor
- bool anIsBicolor = GetGaussPointsPL()->GetBicolor();
- aScalarBarCtrl->SetBicolor(anIsBicolor);
+ // Bicolor
+ bool anIsBicolor = GetGaussPointsPL()->GetBicolor();
+ aScalarBarCtrl->SetBicolor(anIsBicolor);
- aScalarBarCtrl->Update();
+ aScalarBarCtrl->Update();
- for(int i = 0; i < 2; ++i){
- vtkScalarBarActor *aScalarBar = aScalarBarCtrl->GetScalarBarActor(i);
- aScalarBar->SetTitle(myTitle.c_str());
- aScalarBar->SetNumberOfLabels(myNumberOfLabels);
-
- vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
- aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor);
- (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
- (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
- (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
+ for(int i = 0; i < 2; ++i){
+ vtkScalarBarActor *aScalarBar = aScalarBarCtrl->GetScalarBarActor(i);
+ aScalarBar->SetTitle(myTitle.c_str());
+ aScalarBar->SetNumberOfLabels(myNumberOfLabels);
+
+ vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
+ aTitleProp->SetFontFamily(myTitFontType);
+ aTitleProp->SetColor(myTitleColor);
+ (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
+ (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
+ (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
- vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
- aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor);
- (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
- (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
- (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+ vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
+ aLabelProp->SetFontFamily(myLblFontType);
+ aLabelProp->SetColor(myLabelColor);
+ (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
+ (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
+ (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
- aScalarBar->Modified();
+ aScalarBar->Modified();
+ }
}
}
+ else{
+ anActor->SetBarVisibility(false);
+ myPipeLine->GetMapper()->SetScalarVisibility(0);
+
+ anActor->GetProperty()->SetColor(myColor.red() / 255.0,
+ myColor.green() / 255.0,
+ myColor.blue() / 255.0);
+ }
}
+ TSuperClass::UpdateActor(theActor);
}
//----------------------------------------------------------------------------