[vtkusers] Re: vtkObjects and arrays in c++.net

Goodwin Lawlor goodwin.lawlor at ucd.ie
Mon Aug 23 18:34:59 EDT 2004


Hi Martin,

Try this:

int numMappers = 10; // for example

// To create...
// cubeMapper is a pointer to an array of vtkPolyDataMapper pointers
vtkPolyDataMapper **cubeMapper = new vtkPolyDataMapper* [numMappers]

//point each pointer in the array to a new vtkPolyDataMapper object
for (int i =0; i<numMappers; i++)
    {
    cubeMapper[i] = vtkPolyDataMapper::New();
    }

// To clean up...
// Delete each vtkPolyDataMapper object
for (int i =0; i<numMappers; i++)
    {
    cubeMapper[i]->Delete();
    }

// Delete the array or pointers
delete [] cubeMapper;
cubeMappers = NULL;

hth,

Goodwin


"martin larrea" <misiones485_6300 at yahoo.com.ar> wrote in message
news:20040823191205.1169.qmail at web54005.mail.yahoo.com...
Ok, im about to kill my computer...
Im trying to define an array of vtkPolyDataMapper in c++.net in the main
class...

First i tried this.
vtkPolyDataMapper* cubeMapper[];
but i get an error this.
error C2697: 'cubeMapper' : se debe especificar explícitamente __gc o __nogc
para una matriz declarada dentro de un tipo administrado
(English... "must explicit use __gc or __nogc for a matrix declare in an
administrative type)
Ok... second try...
vtkPolyDataMapper* cubeMapper __gc[];
but again
error C2691: 'vtkPolyDataMapper __gc *' : tipo no válido para el elemento de
matriz __gc
(English... "__gc *: type invalid por the matrix element __gc)
I tried other conbinations but none of then work...
Please, any ideas... thanxs a lot.
Martin.


100mb gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
¡Tenelo ya!



_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list