- Timestamp:
- Mar 1, 2006 10:41:00 AM (18 years ago)
- Location:
- trunk/src/mesh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mesh/mesh.cc
r233 r241 57 57 // 58 58 RP_ERROR 59 //RpMesh3d::addAllNodes(int numNodes, int nodes[][3])60 59 RpMesh3d::addAllNodes(int numNodes, int* nodes) 61 60 { … … 127 126 // elemArray: a 2d array, e.g.: 128 127 // static int elem[6][4] = { 129 // 0,1,5,6,130 // 1,2,6,7,131 // 2,3,7,1,132 // 3,4,1,2,133 // 5,6,2,3,134 // 6,7,3,4128 // {0,1,5,6}, 129 // {1,2,6,7}, 130 // {2,3,7,1}, 131 // {3,4,1,2}, 132 // {5,6,2,3}, 133 // {6,7,3,4} 135 134 // }; 136 135 // … … 157 156 // retrieve nodes 158 157 void 159 RpMesh3d::getNode(int nodeSeqNum, int & x, int& y, int&z)158 RpMesh3d::getNode(int nodeSeqNum, int* x, int* y, int* z) 160 159 { 161 160 if (nodeSeqNum < m_numNodes) … … 173 172 } 174 173 175 RP_ERROR 176 RpMesh3d::getNodesList(int* nodesList, int& num) 177 { 174 // 175 // Returns nodes in a list of int (nodesList) 176 // Input: 177 // nodesList: length should be 3*numNodes 178 // numNodes: number of nodes 179 // Returns: 180 // numnodes = number of nodes returned 181 // nodesList = all the nodes in mesh 182 // 183 RP_ERROR 184 RpMesh3d::getNodesList(int* nodesList, int& numNodes) 185 { 186 if (nodesList == NULL) 187 return RP_ERR_NULL_PTR; 188 if (numNodes > m_numNodes) 189 numNodes = m_numNodes; 190 191 int j; 192 for (int i=0; i<numNodes; i++) { 193 j = i * 3; 194 getNode(i, &(nodesList[j]), &(nodesList[j+1]), &(nodesList[j+2])); 195 } 196 178 197 return RP_SUCCESS; 179 198 } -
trunk/src/mesh/mesh.h
r233 r241 36 36 37 37 // retrieve nodes 38 void getNode(int nodeSeqNum, int & x, int& y, int&z);38 void getNode(int nodeSeqNum, int* x, int* y, int* z); 39 39 RP_ERROR getNode(int nodeSeqNum, RpNode3d& node); 40 40 RP_ERROR getNodesList(int* nodesList, int& num);
Note: See TracChangeset
for help on using the changeset viewer.