Re: [osg-users] 2Dimensional array

2008-11-20 Thread christophe loustaunau
there is little mistake with this :
osg::ref_ptr currentDataArray;

it should be :
osg::ref_ptr currentDataArray = new osg::Vec3Array;

With this it should work.

Regards.

On Thu, Nov 20, 2008 at 8:05 PM, Ed <[EMAIL PROTECTED]> wrote:

> So I could do something like this (in pseudocode)?
>
>   std::vector< osg::ref_ptr > myData;
>   osg::Vec3f currentDataPoint;
>   Outerloop...{
>   osg::ref_ptr currentDataArray;
>   Innerloop {
>   currentDataPoint.set(...);
>   currentDataArray->push_back(currentDataPoint);
>   }
>   myData.push_back(currentDataArray);
>   }
>
> Ed
>
> christophe loustaunau wrote:
>
>> Hi Ed,
>>
>> Maybe you could use  std::vector myArray .
>>
>> Regards.
>>
>> On Thu, Nov 20, 2008 at 7:46 PM, Ed <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote:
>>
>>I need to create a 2Dimensional array of Vec3f.  I could do this
>>the ol'
>>
>>osg::Vec3f **myArray
>>
>>way, but wasn't sure if that is the way it "should" be done, as
>>opposed to osg::ref_ptr, etc.   The I thought, maybe there is
>>already a class for 2Dimensional arrays...but I didn't find one.
>> Is there such a class?
>>
>>Ed
>>
>>___
>>osg-users mailing list
>>osg-users@lists.openscenegraph.org
>>
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>>
>>
>> --
>> Christophe Loustaunau.
>> 
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Christophe Loustaunau.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 2Dimensional array

2008-11-20 Thread Ed

So I could do something like this (in pseudocode)?

   std::vector< osg::ref_ptr > myData;   


   osg::Vec3f currentDataPoint;
   Outerloop...{
   osg::ref_ptr currentDataArray;
   Innerloop {
   currentDataPoint.set(...);
   currentDataArray->push_back(currentDataPoint);
   }
   myData.push_back(currentDataArray);
   }

Ed

christophe loustaunau wrote:

Hi Ed,

Maybe you could use  std::vector myArray .

Regards.

On Thu, Nov 20, 2008 at 7:46 PM, Ed <[EMAIL PROTECTED] 
> wrote:


I need to create a 2Dimensional array of Vec3f.  I could do this
the ol'

osg::Vec3f **myArray

way, but wasn't sure if that is the way it "should" be done, as
opposed to osg::ref_ptr, etc.   The I thought, maybe there is
already a class for 2Dimensional arrays...but I didn't find one.
 Is there such a class?

Ed

___
osg-users mailing list
osg-users@lists.openscenegraph.org

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
Christophe Loustaunau.


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 2Dimensional array

2008-11-20 Thread christophe loustaunau
Hi Ed,

Maybe you could use  std::vector myArray .

Regards.

On Thu, Nov 20, 2008 at 7:46 PM, Ed <[EMAIL PROTECTED]> wrote:

> I need to create a 2Dimensional array of Vec3f.  I could do this the ol'
>
> osg::Vec3f **myArray
>
> way, but wasn't sure if that is the way it "should" be done, as opposed to
> osg::ref_ptr, etc.   The I thought, maybe there is already a class for
> 2Dimensional arrays...but I didn't find one.  Is there such a class?
>
> Ed
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Christophe Loustaunau.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] 2Dimensional array

2008-11-20 Thread Dusten Sobotta
Why not use vectors?  std::vector< std::vector< osg::Vec3f > > vec3array;

or ideally, for instantiation/allocation efficiency, std::vector<
std::vector< *osg::Vec3f > >


Dusten

On Thu, Nov 20, 2008 at 12:46 PM, Ed <[EMAIL PROTECTED]> wrote:

> I need to create a 2Dimensional array of Vec3f.  I could do this the ol'
>
> osg::Vec3f **myArray
>
> way, but wasn't sure if that is the way it "should" be done, as opposed to
> osg::ref_ptr, etc.   The I thought, maybe there is already a class for
> 2Dimensional arrays...but I didn't find one.  Is there such a class?
>
> Ed
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] 2Dimensional array

2008-11-20 Thread Ed

I need to create a 2Dimensional array of Vec3f.  I could do this the ol'

osg::Vec3f **myArray

way, but wasn't sure if that is the way it "should" be done, as opposed 
to osg::ref_ptr, etc.   The I thought, maybe there is already a class 
for 2Dimensional arrays...but I didn't find one.  Is there such a class?


Ed

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org