Converting data type

37 views
Skip to first unread message

Ostap Pochtarenko

unread,
Feb 7, 2013, 12:27:12 PM2/7/13
to field...@googlegroups.com
Hi,

Do we have efficient way for converting scalar field to vector field ?

Magnus Wrenninge

unread,
Feb 7, 2013, 1:49:00 PM2/7/13
to field...@googlegroups.com
You should be able to do something along the lines of:

template <class Vector_T, class Scalar_T>
void scalarToVector(typename Scalar_T::Ptr src, typename Vector_T::Ptr tgt)
{
  tgt.matchDefinition(src);
  typename Vector_T::iterator i;
  typename Scalar_T::const_iterator iSrc;
  for (i = tgt.begin(), iSrc = src.begin(), end = tgt.end(); i != end; ++i, ++iSrc) {
    *i = V3f(*iSrc);
  }
}

On Thu, Feb 7, 2013 at 9:27 AM, Ostap Pochtarenko <rili...@gmail.com> wrote:
Hi,

Do we have efficient way for converting scalar field to vector field ?

--
You received this message because you are subscribed to the Google Groups "Field3D dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to field3d-dev...@googlegroups.com.
To post to this group, send email to field...@googlegroups.com.
Visit this group at http://groups.google.com/group/field3d-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ostap Pochtarenko

unread,
Feb 8, 2013, 11:27:38 AM2/8/13
to field...@googlegroups.com
Thanks Magnus

Четвер, 7 лютого 2013 р. 20:49:00 UTC+2 користувач Magnus Wrenninge написав:
Reply all
Reply to author
Forward
0 new messages