Esempio n. 1
0
Polyhedron::Polyhedron(Mesh ** mlist, unsigned int nmeshes)
{
    MeshList   meshes;
    unsigned int idx;

    /* Check the input. If list is NULL or the number of points is zero, return. */
    if (nmeshes == 0 || mlist == NULL)
        return;

    for (idx = 0; idx < nmeshes; idx++)
        meshes.push_back(mlist[idx]);

    mode = GL_POLYGON;
    getPoints(&meshes);
}
Esempio n. 2
0
        void
CLxVertexSelection::GetDirectList (
        MeshList		&list)
{
        CLxUser_Item		 item;
        MeshEntry		 entry;
        LXtScanInfoID		 scan;
        LXtPointID		 vrt;
        const char		*id;
        void			*pkt;
        size_t			 k;

        std::map<const char *, size_t>			entries;
        std::map<const char *, size_t>::iterator	eit;

        list.clear ();

        scan = 0;
        while (scan = srv_sel.ScanLoop (scan, sel_ID, &pkt)) {
                pkt_trans.Vertex (pkt, &vrt);

                pkt_trans.GetItem (pkt, item);
                item.Ident (&id);
                eit = entries.find (id);

                if (eit == entries.end ()) {
                        entry.item.set (item);
                        pkt_trans.GetMesh (pkt, entry.mesh);

                        k = list.size ();
                        entries[id] = k;
                        list.push_back (entry);
                } else
                        k = eit->second;

                list[k].list.push_back (vrt);
        }
}