?? facet.cpp
字號:
/////////////////////////////////////////////////////////////////////////////////
//
// Facet.cpp: implementation of the CFacet class.
//
////////////////////////////////////////////////////////////////////////////////
// 版權(quán)所有(2002)
// Copyright(2002)
// 編寫者: 向世明
// Author: Xiang Shiming
#include "stdafx.h"
#include "Facet.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CFacet::CFacet()
{
//小面法線:指向Z軸
m_normal.x = m_normal.y = 0.0f; m_normal.z = 1.0f;
//為了便于操作, 設(shè)置大小為0
m_avIndex.SetSize(0);
}
CFacet::CFacet(const CFacet& fctSrc)
{
m_clr = fctSrc.m_clr;
m_normal = fctSrc.m_normal;
m_bVisibility = fctSrc.m_bVisibility;
m_avIndex.SetSize(fctSrc.m_avIndex.GetSize());
m_avIndex.Copy(fctSrc.m_avIndex);
m_avIndex.FreeExtra();
}
CFacet::~CFacet()
{
m_avIndex.RemoveAll();
}
//重載 " = " 運算符
CFacet CFacet::operator = (const CFacet& fctSrc)
{
m_clr = fctSrc.m_clr;
m_normal = fctSrc.m_normal;
m_bVisibility = fctSrc.m_bVisibility;
m_avIndex.SetSize(fctSrc.m_avIndex.GetSize());
m_avIndex.Copy(fctSrc.m_avIndex);
m_avIndex.FreeExtra();
return *this;
}
//定義小面的拓撲(點序號)
//pnVertex-----組成小面的頂點序號數(shù)組
//nNumVertex----頂點個數(shù)
void CFacet::DefineTopology(const int* pnVertex, int nNumVertex)
{
ASSERT(nNumVertex > 2);
m_avIndex.SetSize(nNumVertex);
for(int i = 0; i < nNumVertex; i++)
m_avIndex[i] = pnVertex[i];
m_avIndex.FreeExtra();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -