[vtkusers] syntax question

A J lost_bits1110 at hotmail.com
Tue Jun 8 15:45:42 EDT 2004


Actually just before it ccrashes it shows these errors:

Creating an array of Stuff
Hello World in B Class!
hello world completed
     15781:     symbol=_ZN24vtkSimpleCriticalSectionD1Ev;  lookup in 
file=runit
     15781:     symbol=_ZN24vtkSimpleCriticalSectionD1Ev;  lookup in 
file=/usr/local/src/vtk/vtkbin/bin/libvtkAtamaiTracking.so
     15781:     symbol=_ZN24vtkSimpleCriticalSectionD1Ev;  lookup in 
file=/usr/local/src/vtk/vtkbin/bin/libvtkCommon.so
Segmentation fault (core dumped)


..which is weired..??  Im not even using these classes...!

Can someone try doing

        vtkBclass **Stuff;
	for (int i=0; i<20; i++)
		Stuff[i] = vtkBclass::New();

	Stuff[5]->HelloWorld();

or something similar and see if it works or crashes for them..?

Thanks!!





>Oh hrm, I seem to have totally glazed over that you were
>trying to allocate an array... Sorry 'bout that.
>
>Interesting question. Perhaps
>
>vtkBclass **stuff = vtkBclass::New()*[number]
>
>would do what you wanted?
>
>Just a stab in the dark.. I'll be interested to hear the
>solution.
>
>-tom
>
>  <BAY99-F53CTVuy16xso0000c978 at hotmail.com>"A J" writes:
> >Yes thanks tom , I've already inherited these from vtkObject,
> >but now this means that instead of doing
> >
> >Bclass *stuff = new Bclass[ number ]
> >
> >I now have to do something like
> >
> >vtkBclass **stuff = vtkBclass::New() [number]
> >
> >or...???
> >
> >I just want a pointer to an array of vtkBclass's, not just one which 
>would
> >obviously just be
> >vtkBclass *stuff = vtkBclass::New();
> >
> >
> >
> >
> >>AJ, use Bclass' New() member function.
> >>
> >>You should derive Bclass (and Aclass, for that matter) from a
> >>vtkObject and it will then automagically obtain the vtkObject::New()
> >>member function.
> >>
> >>Also, you should make sure your vtk* objects have their constructors
> >>and destructors declared as protected, and additionally that the
> >>destructors are declared virtual.
> >>
> >>HTH,
> >>
> >>-tom
> >>
> >>  <BAY99-F504GCjNNsqlt0003748a at hotmail.com>"A J" writes:
> >> >Hi,
> >> >
> >> >Say I have my own classes called Aclass and Bclass
> >> >
> >> >and say I have now wrapped these to VTK classes so they are now known 
>as
> >> >vtkAclass and vtkBclass
> >> >
> >> >Originally, I had:
> >> >
> >> >class Aclass
> >> >{
> >> >
> >> >public:
> >> >Bclass *stuff = new Bclass[ number ]
> >> >  ....
> >> >}
> >> >
> >> >
> >> >So now that Aclass has become vtkAclass and same for vtkBclass.. what 
>is
> >>the
> >> >syntax to do this with the New() operator that I now have to use..?  I
> >>had
> >> >tried a few things but nothign works so far.. it must be something 
>very
> >> >basic..! =S
> >> >
> >> >Thanks!!
> >> >
> >> >_________________________________________________________________
> >> >Watch the online reality show Mixed Messages with a friend and enter 
>to
> >>win
> >> >a trip to NY
> >> 
> >http://www.msnmessenger-download.click-url.com/go/onm00200497ave/direct/01/
> >> >
> >> >_______________________________________________
> >> >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
> >
> >_________________________________________________________________
> >Is your PC infected? Get a FREE online computer virus scan from McAfee®
> >Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> >
> >_______________________________________________
> >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

_________________________________________________________________
Watch the online reality show Mixed Messages with a friend and enter to win 
a trip to NY 
http://www.msnmessenger-download.click-url.com/go/onm00200497ave/direct/01/




More information about the vtkusers mailing list