Commit ca073466 authored by Ken Martin's avatar Ken Martin

in progress

Change-Id: I9f2bafb8707c86180a0893280474c101593cc9c0
parent 738b812b
......@@ -76,8 +76,8 @@ int TestPDBBallAndStick(int argc, char *argv[])
double firstRender = timer->GetElapsedTime();
cerr << "first render time: " << firstRender << endl;
/*
int numRenders = 15;
int numRenders = 85;
timer->StartTimer();
for (int i = 0; i < numRenders; ++i)
{
......@@ -96,7 +96,7 @@ int TestPDBBallAndStick(int argc, char *argv[])
ren->GetActiveCamera()->Zoom(1.7);
win->Render();
*/
// Finally render the scene and compare the image to a reference image
win->SetMultiSamples(0);
win->GetInteractor()->Initialize();
......
......@@ -10,6 +10,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
FrustumClip.cxx
Mace.cxx
RGrid.cxx
vtkCmbGlyphMappingTest3.cxx,NO_VALID
TestActor2DTextures.cxx
TestActorLightingFlag.cxx
TestAnimationScene.cxx
......
/*=========================================================================
Copyright (c) 1998-2005 Kitware Inc. 28 Corporate Drive, Suite 204,
Clifton Park, NY, 12065, USA.
All rights reserved. No part of this software may be reproduced,
distributed,
or modified, in any form or by any means, without permission in writing from
Kitware Inc.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
"AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkCellData.h"
#include "vtkPolyDataMapper.h"
#include "vtkProperty.h"
#include "vtkSmartPointer.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkInteractorStyleSwitch.h"
#include "vtkCmbGlyphPointSource.h"
#include "vtkGlyph3DMapper.h"
#include "vtkCylinderSource.h"
#include "vtkCamera.h"
#include <string>
#include "vtkTesting.h"
#include "vtkTimerLog.h"
#include "vtkNew.h"
#include "vtkCmbGlyphPointSource.cxx"
//----------------------------------------------------------------------------
// Tests Glyph Point Source's individual property settings
int vtkCmbGlyphMappingTest3(int argc, char *argv[])
{
int n = 300;
vtkSmartPointer<vtkTesting> testHelper = vtkSmartPointer<vtkTesting>::New();
testHelper->AddArguments(argc,const_cast<const char **>(argv));
vtkNew<vtkTimerLog> timer;
vtkNew<vtkRenderWindow> renWin;
renWin->SetSize(800,800);
vtkNew<vtkRenderer> renderer;
vtkNew<vtkRenderWindowInteractor> iren;
vtkNew<vtkInteractorStyleSwitch> style;
style->SetCurrentStyleToTrackballCamera();
iren->SetInteractorStyle( style.GetPointer() );
iren->SetRenderWindow(renWin.GetPointer());
renWin->AddRenderer( renderer.GetPointer() );
vtkNew<vtkCmbGlyphPointSource> points;
// Lets create some points
int i, j, vis;
double x, y, s, delta = 1.0;
double start = -0.5 * delta * n;
vtkIdType id;
int k;
int pointCount = 0;
for (j = 0, y = start; j < n; j++, y+=delta)
{
for (i = 0, x = start; i < n; i++, x+=delta)
{
vis = 1;
s = 10;
k = i+j;
if ((k % 2) == 0)
{
id = points->InsertNextPoint(x, 0.0, y);
points->SetGlyphType(id, 0);
points->SetColor(id, 1.0, 0.0, 0.0, 1.0);
points->SetVisibility(id, vis);
points->SetScale(id, 1.0, s, 1.0);
id = points->InsertNextPoint(x, 0.0, y);
points->SetGlyphType(id, 1);
points->SetColor(id, 1.0, 1.0, 0.0, 1.0);
points->SetVisibility(id, vis);
points->SetScale(id, 1, s*.99, 1);
pointCount += 2;
}
else if ((k % 3) == 0)
{
id = points->InsertNextPoint(x, 0.0, y);
points->SetGlyphType(id, 3);
points->SetColor(id, 1.0, 0.7, 0.0, 1.0);
points->SetVisibility(id, vis);
points->SetScale(id, 1, s, 1);
pointCount++;
}
else
{
id = points->InsertNextPoint(x, 0.0, y);
points->SetGlyphType(id, 2);
points->SetColor(id, 0.5, 1.0, 0.5, 1.0);
points->SetVisibility(id, vis);
points->SetScale(id, 1, s, 1);
pointCount++;
}
}
}
vtkNew<vtkCylinderSource> cyl;
cyl->CappingOn();
cyl->SetRadius(0.2);
cyl->SetResolution(18);
cyl->Update();
vtkNew<vtkCylinderSource> cyl1;
cyl1->CappingOn();
cyl1->SetRadius(0.4);
cyl1->SetResolution(18);
cyl1->Update();
vtkNew<vtkCylinderSource> cyl2;
cyl2->CappingOn();
cyl2->SetRadius(0.4);
cyl2->SetResolution(18);
cyl2->Update();
vtkNew<vtkCylinderSource> cyl3;
cyl3->CappingOn();
cyl3->SetRadius(0.3);
cyl3->SetResolution(18);
cyl3->Update();
int polygons = pointCount*cyl->GetOutput()->GetPolys()->GetNumberOfCells();
vtkNew<vtkGlyph3DMapper> mapper;
mapper->SetSourceConnection(0, cyl->GetOutputPort() );
mapper->SetSourceConnection(1, cyl1->GetOutputPort() );
mapper->SetSourceConnection(2, cyl2->GetOutputPort() );
mapper->SetSourceConnection(3, cyl3->GetOutputPort() );
mapper->SetInputConnection(points->GetOutputPort());
mapper->SetMaskArray("Visibility");
mapper->SetOrientationArray("Orientation");
mapper->SetScaleArray("Scaling");
mapper->SetSourceIndexArray("GlyphType");
mapper->SetMasking(true);
if (!testHelper->IsFlagSpecified("-N"))
{
mapper->SetSourceIndexing(true);
mapper->SetRange(0.0,3.0);
}
mapper->SetOrientationModeToRotation();
mapper->SetScaleModeToScaleByVectorComponents();
vtkNew<vtkActor> actor;
actor->SetMapper( mapper.GetPointer() );
renderer->AddViewProp( actor.GetPointer() );
renderer->ResetCamera();
timer->StartTimer();
iren->Initialize();
renWin->Render();
timer->StopTimer();
cout << "First frame time: " << timer->GetElapsedTime() << "\n";
timer->StartTimer();
for (i = 0; i <= 100; i++)
{
renderer->GetActiveCamera()->Elevation(0.9);
renderer->GetActiveCamera()->Zoom(1.02);
renWin->Render();
}
timer->StopTimer();
double t = timer->GetElapsedTime();
cout << "Avg Frame time: " << t/100.0 << " Frame Rate: " << 100.0 / t << "\n";
cout << " polygons: " << polygons << " Mpolys/sec: " << 100.0*polygons/(1000000.0*t) << "\n";
int retVal = vtkTesting::PASSED;
if (testHelper->IsFlagSpecified("-V"))
{
testHelper->SetRenderWindow(renWin.GetPointer());
retVal = testHelper->RegressionTest(10);
}
if (testHelper->IsInteractiveModeSpecified())
{
iren->Start();
}
return (retVal == vtkTesting::PASSED) ? 0 : 1;
}
This diff is collapsed.
/*=========================================================================
Copyright (c) 1998-2012 Kitware Inc. 28 Corporate Drive,
Clifton Park, NY, 12065, USA.
All rights reserved. No part of this software may be reproduced,
distributed,
or modified, in any form or by any means, without permission in writing from
Kitware Inc.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
"AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO
PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
// .NAME vtkCmbGlyphPointSource - Represents a set of points that will be used for Glyphing
// .SECTION Description
// The input Source data is shallow copied to the output
#ifndef __vtkCmbGlyphPointSource_h
#define __vtkCmbGlyphPointSource_h
//#include "vtkCMBFilteringModule.h" // For export macro
#include "vtkPolyDataAlgorithm.h"
#include "vtkSmartPointer.h"
//#include "cmbSystemConfig.h"
class vtkPoints;
class vtkUnsignedCharArray;
class vtkDoubleArray;
class vtkBitArray;
class vtkIntArray;
class vtkCellArray;
class vtkTransform;
class vtkCmbGlyphPointSource : public vtkPolyDataAlgorithm
{
public:
static vtkCmbGlyphPointSource *New();
vtkTypeMacro(vtkCmbGlyphPointSource,vtkPolyDataAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Insert the next point into the object
vtkIdType InsertNextPoint(double x, double y, double z);
vtkIdType InsertNextPoint(double p[3])
{ return this->InsertNextPoint(p[0], p[1], p[2]);}
// Description:
// Insert the next point and its properties into the object
vtkIdType InsertNextPoint(double x, double y, double z,
double r, double g, double b, double a,
double sx, double sy, double sz,
double ox, double oy, double oz,
int vis);
void SetScale(vtkIdType index, double sx, double sy, double sz);
void SetOrientation(vtkIdType index, double ox, double oy, double oz);
void ApplyTransform(double *orinetationDelta, double *positionDelta,
double *scaleDelta);
void ApplyTransform(vtkIdType index, double *orinetationDelta,
double *positionDelta, double *scaleDelta);
double *GetBounds(vtkIdType index);
void SetVisibility(vtkIdType index, int flag);
void SetGlyphType(vtkIdType index, int type);
void SetColor(vtkIdType index, double r, double g, double b, double a);
void UnsetColor(vtkIdType index);
void ResetColorsToDefault();
vtkIdType GetNumberOfPoints()
{
return this->Source->GetNumberOfPoints();
}
void SetPoint(vtkIdType index, double x, double y, double z);
void GetPoint(vtkIdType index, double *p);
double *GetPoint(vtkIdType index)
{
this->GetPoint(index, this->TempData);
return this->TempData;
}
void GetScale(vtkIdType index, double *s);
double *GetScale(vtkIdType index)
{
this->GetScale(index, this->TempData);
return this->TempData;
}
void GetOrientation(vtkIdType index, double *o);
double *GetOrientation(vtkIdType index)
{
this->GetOrientation(index, this->TempData);
return this->TempData;
}
int GetVisibility(vtkIdType index);
void GetColor(vtkIdType index, double *color);
double *GetColor(vtkIdType index)
{
this->GetColor(index, this->TempData);
return this->TempData;
}
void SetDefaultColor(double r, double g, double b, double a);
const double *GetDefaultColor() const
{
return this->DefaultColor;
}
void SetGlyphSourceBounds(double bounds[6])
{
for(int i=0; i<6; i++)this->GlyphSourceBounds[i]=bounds[i];
}
const double *GetGlyphSourceBounds() const
{
return this->GlyphSourceBounds;
}
// Load the point information from a file
void ReadFromFile(const char *);
// Write the point information to a file
void WriteToFile(const char *);
protected:
vtkCmbGlyphPointSource();
~vtkCmbGlyphPointSource();
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
vtkSmartPointer<vtkPolyData>Source;
vtkSmartPointer<vtkPoints> Points;
vtkSmartPointer<vtkUnsignedCharArray>Color;
vtkSmartPointer<vtkBitArray>Visibility;
vtkSmartPointer<vtkBitArray>SelectionMask;
vtkSmartPointer<vtkDoubleArray>Scaling;
vtkSmartPointer<vtkDoubleArray>Orientation;
vtkSmartPointer<vtkCellArray>CellIds;
vtkSmartPointer<vtkTransform>Transform;
vtkSmartPointer<vtkIntArray>GlyphType;
double TempData[6];
double DefaultColor[4];
double GlyphSourceBounds[6];
private:
vtkCmbGlyphPointSource(const vtkCmbGlyphPointSource&); // Not implemented.
void operator=(const vtkCmbGlyphPointSource&); // Not implemented.
};
#endif
......@@ -33,6 +33,9 @@
#include "vtkShader.h"
#include "vtkShaderProgram.h"
#include "vtkBitArray.h"
#include "vtkDataObject.h"
using vtkgl::replace;
......@@ -51,115 +54,132 @@ vtkOpenGLGlyph3DHelper::~vtkOpenGLGlyph3DHelper()
{
}
void vtkOpenGLGlyph3DHelper::GlyphRender(vtkRenderer* ren, vtkActor* actor, unsigned char rgba[4], vtkMatrix4x4 *gmat, int stage)
void vtkOpenGLGlyph3DHelper::GlyphRender(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
std::vector<unsigned char> &colors, std::vector<float> &matrices)
{
// handle starting up
if (stage == 1)
{
this->RenderPieceStart(ren,actor);
this->UpdateShader(this->Tris, ren, actor);
this->Tris.ibo.Bind();
return;
}
// handle ending
if (stage == 3)
{
this->Tris.ibo.Release();
this->RenderPieceFinish(ren,actor);
return;
}
// handle the middle
vtkShaderProgram *program = this->Tris.Program;
vtkgl::VBOLayout &layout = this->Layout;
bool primed = false;
unsigned char rgba[4];
vtkHardwareSelector* selector = ren->GetSelector();
bool selecting_points = selector && (selector->GetFieldAssociation() ==
vtkDataObject::FIELD_ASSOCIATION_POINTS);
// these next four lines could be cached and passed in to save time
vtkCamera *cam = ren->GetActiveCamera();
vtkNew<vtkMatrix4x4> tmpMat;
tmpMat->DeepCopy(cam->GetModelViewTransformMatrix());
vtkMatrix4x4::Multiply4x4(tmpMat.Get(), actor->GetMatrix(), tmpMat.Get());
double arrayVals[16];
vtkNew<vtkTransform> aTF;
vtkNew<vtkMatrix3x3> tmpMat3d;
vtkNew<vtkMatrix4x4> actCamMatrix;
vtkMatrix4x4::Multiply4x4(cam->GetModelViewTransformMatrix(), actor->GetMatrix(), actCamMatrix.Get());
// Apply this extra transform from things like the glyph mapper.
vtkMatrix4x4::Multiply4x4(tmpMat.Get(), gmat, tmpMat.Get());
for (vtkIdType inPtId = 0; inPtId < numPts; inPtId++)
{
rgba[0] = colors[inPtId*4];
rgba[1] = colors[inPtId*4+1];
rgba[2] = colors[inPtId*4+2];
rgba[3] = colors[inPtId*4+3];
tmpMat->Transpose();
program->SetUniformMatrix("MCVCMatrix", tmpMat.Get());
if (selecting_points)
{
selector->RenderAttributeId(rgba[0] + (rgba[1] << 8) + (rgba[2] << 16));
}
if (!primed)
{
this->RenderPieceStart(ren,actor);
this->UpdateShader(this->Tris, ren, actor);
this->Tris.ibo.Bind();
primed = true;
}
// for lit shaders set normal matrix
if (this->LastLightComplexity > 0)
{
// handle the middle
vtkShaderProgram *program = this->Tris.Program;
vtkgl::VBOLayout &layout = this->Layout;
// Apply the extra transform
for (int i = 0; i < 16; i++)
{
arrayVals[i] = matrices[inPtId*16+i];
}
vtkMatrix4x4::Multiply4x4((double *)actCamMatrix.Get()->Element, arrayVals, (double *)tmpMat.Get()->Element);
tmpMat->Transpose();
program->SetUniformMatrix("MCVCMatrix", tmpMat.Get());
// set the normal matrix and send it down
// (make this a function in camera at some point returning a 3x3)
// Reuse the matrix we already got (and possibly multiplied with model mat.
vtkNew<vtkTransform> aTF;
aTF->SetMatrix(tmpMat.Get());
double *scale = aTF->GetScale();
aTF->Scale(1.0 / scale[0], 1.0 / scale[1], 1.0 / scale[2]);
tmpMat->DeepCopy(aTF->GetMatrix());
vtkNew<vtkMatrix3x3> tmpMat3d;
for(int i = 0; i < 3; ++i)
// for lit shaders set normal matrix
if (this->LastLightComplexity > 0)
{
for (int j = 0; j < 3; ++j)
tmpMat->Transpose();
// set the normal matrix and send it down
// (make this a function in camera at some point returning a 3x3)
// Reuse the matrix we already have (and possibly multiplied with model mat.
aTF->SetMatrix(tmpMat.Get());
double *scale = aTF->GetScale();
aTF->Scale(1.0 / scale[0], 1.0 / scale[1], 1.0 / scale[2]);
tmpMat->DeepCopy(aTF->GetMatrix());
for(int i = 0; i < 3; ++i)
{
tmpMat3d->SetElement(i, j, tmpMat->GetElement(i, j));
for (int j = 0; j < 3; ++j)
{
tmpMat3d->SetElement(i, j, tmpMat->GetElement(i, j));
}
}
tmpMat3d->Invert();
program->SetUniformMatrix("normalMatrix", tmpMat3d.Get());
}
tmpMat3d->Invert();
program->SetUniformMatrix("normalMatrix", tmpMat3d.Get());
}
// Query the actor for some of the properties that can be applied.
float diffuseColor[3] = {rgba[0]/255.0f,rgba[1]/255.0f,rgba[2]/255.0f};
float opacity = rgba[3]/255.0f;
// Query the actor for some of the properties that can be applied.
float diffuseColor[3] = {rgba[0]/255.0f,rgba[1]/255.0f,rgba[2]/255.0f};
float opacity = rgba[3]/255.0f;
program->SetUniformf("opacityUniform", opacity);
program->SetUniform3f("diffuseColorUniform", diffuseColor);
program->SetUniformf("opacityUniform", opacity);
program->SetUniform3f("diffuseColorUniform", diffuseColor);
vtkHardwareSelector* selector = ren->GetSelector();
if (selector)
{
program->SetUniform3f("mapperIndex", selector->GetPropColorValue());
float *fv = selector->GetPropColorValue();
int iv = (int)(fv[0]*255) + (int)(fv[1]*255)*256;
if (iv == 0)
if (selector)
{
abort();
program->SetUniform3f("mapperIndex", selector->GetPropColorValue());
float *fv = selector->GetPropColorValue();
int iv = (int)(fv[0]*255) + (int)(fv[1]*255)*256;
if (iv == 0)
{
abort();
}
}
}
// First we do the triangles, update the shader, set uniforms, etc.
if (actor->GetProperty()->GetRepresentation() == VTK_POINTS)
{
glDrawRangeElements(GL_POINTS, 0,
static_cast<GLuint>(layout.VertexCount - 1),
static_cast<GLsizei>(this->Tris.indexCount),
// First we do the triangles, update the shader, set uniforms, etc.
if (actor->GetProperty()->GetRepresentation() == VTK_POINTS)
{
glDrawRangeElements(GL_POINTS, 0,
static_cast<GLuint>(layout.VertexCount - 1),
static_cast<GLsizei>(this->Tris.indexCount),
GL_UNSIGNED_INT,
reinterpret_cast<const GLvoid *>(NULL));
}
if (actor->GetProperty()->GetRepresentation() == VTK_WIREFRAME)
{
// TODO wireframe of triangles is not lit properly right now
// you either have to generate normals and send them down
// or use a geometry shader.
glMultiDrawElements(GL_LINE_LOOP,
(GLsizei *)(&this->Tris.elementsArray[0]),
GL_UNSIGNED_INT,
reinterpret_cast<const GLvoid *>(NULL));
}
if (actor->GetProperty()->GetRepresentation() == VTK_WIREFRAME)
{
// TODO wireframe of triangles is not lit properly right now
// you either have to generate normals and send them down
// or use a geometry shader.
glMultiDrawElements(GL_LINE_LOOP,
(GLsizei *)(&this->Tris.elementsArray[0]),
GL_UNSIGNED_INT,
reinterpret_cast<const GLvoid **>(&(this->Tris.offsetArray[0])),
(GLsizei)this->Tris.offsetArray.size());
reinterpret_cast<const GLvoid **>(&(this->Tris.offsetArray[0])),
(GLsizei)this->Tris.offsetArray.size());
}
if (actor->GetProperty()->GetRepresentation() == VTK_SURFACE)
{
glDrawRangeElements(GL_TRIANGLES, 0,
static_cast<GLuint>(layout.VertexCount - 1),
static_cast<GLsizei>(this->Tris.indexCount),
GL_UNSIGNED_INT,
reinterpret_cast<const GLvoid *>(NULL));
}
}
if (actor->GetProperty()->GetRepresentation() == VTK_SURFACE)
if (primed)
{
glDrawRangeElements(GL_TRIANGLES, 0,
static_cast<GLuint>(layout.VertexCount - 1),
static_cast<GLsizei>(this->Tris.indexCount),
GL_UNSIGNED_INT,
reinterpret_cast<const GLvoid *>(NULL));
this->Tris.ibo.Release();
this->RenderPieceFinish(ren,actor);
}
}
//-----------------------------------------------------------------------------
......@@ -188,8 +208,14 @@ void vtkOpenGLGlyph3DHelper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
// Apply this extra transform from the glyph mapper.
if (this->ModelTransformMatrix)
{
vtkMatrix4x4::Multiply4x4(tmpMat.Get(), this->ModelTransformMatrix,
tmpMat.Get());
double arrayVals[16];
for (int i = 0; i < 16; i++)
{
arrayVals[i] = this->ModelTransformMatrix[i];
}
vtkMatrix4x4::Multiply4x4((double *)tmpMat.Get()->Element, arrayVals,
(double *)tmpMat.Get()->Element);
}
tmpMat->Transpose();
......
......@@ -21,6 +21,8 @@
#include "vtkRenderingOpenGL2Module.h" // For export macro
#include "vtkOpenGLPolyDataMapper.h"
class vtkBitArray;
class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLGlyph3DHelper : public vtkOpenGLPolyDataMapper
{
public:
......@@ -28,7 +30,7 @@ public:
vtkTypeMacro(vtkOpenGLGlyph3DHelper, vtkOpenGLPolyDataMapper)
void PrintSelf(ostream& os, vtkIndent indent);
void SetModelTransform(vtkMatrix4x4* matrix)
void SetModelTransform(float *matrix)
{
this->ModelTransformMatrix = matrix;
}
......@@ -43,7 +45,8 @@ public:
// Description
// Fast path for rendering glyphs comprised of only one type of primative
void GlyphRender(vtkRenderer* ren, vtkActor* actor, unsigned char rgba[4], vtkMatrix4x4 *gmat, int stage);
void GlyphRender(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
std::vector<unsigned char> &colors, std::vector<float> &matrices);
protected:
vtkOpenGLGlyph3DHelper();
......@@ -57,7 +60,7 @@ protected:
// Set the shader parameteres related to the property
virtual void SetPropertyShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
vtkMatrix4x4* ModelTransformMatrix;
float* ModelTransformMatrix;
unsigned char ModelColor[4];
private:
......
......@@ -28,11 +28,10 @@
#include "vtkRenderingOpenGL2Module.h" // For export macro
#include "vtkGlyph3DMapper.h"
#include "vtkGlyph3D.h" // for the constants (VTK_SCALE_BY_SCALAR, ...).
#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
#include "vtkNew.h" // For vtkNew
class vtkOpenGLGlyph3DHelper;
class vtkBitArray;