| 155 | ////////////////////////////////////////////////////////////////////////// |
| 156 | |
| 157 | PointsPrimitiveEvaluator::PointsPrimitiveEvaluator( ConstPointsPrimitivePtr points ) |
| 158 | : m_pointsPrimitive( points->copy() ), m_haveTree( false ) |
| 159 | { |
| 160 | PrimitiveVariableMap::iterator pIt = m_pointsPrimitive->variables.find( "P" ); |
| 161 | if( pIt==m_pointsPrimitive->variables.end() ) |
| 162 | { |
| 163 | throw InvalidArgumentException( "No PrimitiveVariable named P on PointsPrimitive." ); |
| 164 | } |
| 165 | m_p = pIt->second; |
| 166 | if( !m_p.data || !m_p.data->isInstanceOf( V3fVectorData::staticTypeId() ) ) |
| 167 | { |
| 168 | throw InvalidArgumentException( "PrimitiveVariable P is not of type V3fVectorData." ); |
| 169 | } |
| 170 | m_pVector = &( boost::static_pointer_cast<const V3fVectorData>( m_p.data )->readable() ); |
| 171 | } |
| 172 | |
| 173 | PointsPrimitiveEvaluator::~PointsPrimitiveEvaluator() |
| 174 | { |