Changeset 297 for trunk


Ignore:
Timestamp:
07/31/14 08:34:41 (11 years ago)
Author:
epyon
Message:
  • mesh_data/mesh_nodes_data by name mesh/node retrieval
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/interface/mesh_data.hh

    r295 r297  
    235235                        if ( i >= m_count ) return nullptr;
    236236                        return &m_nodes[i];
     237                }
     238
     239                const mesh_node_data* get_node( const std::string& name ) const
     240                {
     241                        for ( uint32 i = 0; i < m_count; ++i )
     242                        {
     243                                if ( m_nodes[ i ].name == name )
     244                                        return &m_nodes[ i ];
     245                        }
     246                        return nullptr;
     247                }
     248
     249                int get_node_index( const std::string& name ) const
     250                {
     251                        for ( uint32 i = 0; i < m_count; ++i )
     252                        {
     253                                if ( m_nodes[ i ].name == name )
     254                                        return (int)i;
     255                        }
     256                        return -1;
    237257                }
    238258
     
    281301                        return &m_meshes[ index ];
    282302                }
     303                const mesh_data* get_mesh( const std::string& name ) const
     304                {
     305                        for ( uint32 i = 0; i < m_count; ++i )
     306                        {
     307                                if ( m_meshes[ i ].get_name() == name )
     308                                        return &m_meshes[ i ];
     309                        }
     310                        return nullptr;
     311                }
    283312                uint32 get_count() const { return m_count; }
    284313                const mesh_nodes_data* get_nodes() const { return m_nodes; }
Note: See TracChangeset for help on using the changeset viewer.