void operator()( const osg::Vec3 v1, const osg::Vec3 v2, const osg::Vec3 v3, bool temp )
 {
     if ( v1==v2 || v1==v3 || v2==v3 )
         return;
     
     vertices->push_back( v1 ); indices->push_back( base++ );
     vertices->push_back( v2 ); indices->push_back( base++ );
     vertices->push_back( v3 ); indices->push_back( base++ );
 }
Beispiel #2
0
    void updateBound(osg::Vec3Array& vertices)
    {
        // set up matrix
        osg::Matrix matrix;
        if (!_matrixStack.empty()) matrix = _matrixStack.back();

        // set up ellipsoid model
        osg::EllipsoidModel* em = !_csnStack.empty() ?  _csnStack.back()->getEllipsoidModel() : 0;

        for(osg::Vec3Array::iterator itr = vertices.begin();
            itr != vertices.end();
            ++itr)
        {
            osg::Vec3d v = osg::Vec3d(*itr) * matrix;
            if (em) convertXYZToLatLongHeight(em, v);

            updateBound(v);
        }
    }
Beispiel #3
0
        virtual void apply(osg::Vec3Array& array)
        {
            if (_pointList.size()!=array.size()) return;

            for(unsigned int i=0;i<_pointList.size();++i)
            {
                _pointList[i] = new EdgeCollector::Point;
                _pointList[i]->_index = i;

                _pointList[i]->_vertex = array[i];
            }
        }
Beispiel #4
0
    inline void buildMesh( const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3 )
    {
        osg::Vec3* cb = &(_coordArray->front());
        int p1=&v1-cb, p2=&v2-cb, p3=&v3-cb;
        PolyMesh::Face* face =  new PolyMesh::Face( _coordArray, p1, p2, p3 );
        _meshFaces->push_back( face );

        EqualGroup g1=_coordSet.equal_range(&v1),
                   g2=_coordSet.equal_range(&v2),
                   g3=_coordSet.equal_range(&v3);
        buildEdge( g1, g2, face );
        buildEdge( g2, g3, face );
        buildEdge( g3, g1, face );
    }
Beispiel #5
0
	// do nothing
	void operator ()(const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3, bool treatVertexDataAsTemporary) {
		_vertexes->push_back(v1);
		_vertexes->push_back(v2);
		_vertexes->push_back(v3);
	}