?? face.cpp
字號:
// Face.cpp: implementation of the Face class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Subdiv.h"
#include "Face.h"
#include <iostream>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Face::Face(vector<int> & faceVertexsIdx, int idx) //m_index:idx, m_newFacePointIdx:-1, m_vertexIdxSet:faceVertexsIdx
{
m_index = idx;
m_newFacePointIdx = -1;
this->m_vertexIdxSet = faceVertexsIdx;
}
Face::~Face()
{
reset();
}
int Face::getVertexNumber()//頂點數目
{ // must be a close face
return m_vertexIdxSet.size();
}
/*
void Face::addEdge(Mesh::EDGEPOS edgeIdx)
{
m_edgePosSet.push_back(edgeIdx);
// dump();
}*/
bool Face::operator == (const Face& f) const
{
ASSERT(m_index != -1 && f.m_index != -1);
return (m_index == f.m_index);
}
void Face::dump() const
{
cout << "DUMP: Face " << m_index + 1 << " face point idx:" << m_newFacePointIdx << endl;
cout << " Edges: " ;
for(EDGEPOSSET::const_iterator itr = m_edgePosSet.begin(); itr != m_edgePosSet.end(); itr ++)
cout << "<" << (*itr)->m_bgVertexIdx + 1 << "," << (*itr)->m_edVertexIdx + 1 << "> " ;
// cout << endl;
cout << " Vertexs: " ;
for(VERTEXPOSSET::const_iterator itr2 = m_vertexIdxSet.begin(); itr2 != m_vertexIdxSet.end(); itr2 ++)
cout << (*itr2) + 1 << " ";
cout << endl;
}
void Face::reset()
{
m_vertexIdxSet.clear();
m_edgePosSet.clear();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -