Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
c5721c306This file is pinned to the selected release. Download the original to open it in your design tool.
// Loop.cpp
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#include "stdafx.h"
#include "Loop.h"
#include "Face.h"
#include "Edge.h"
// static
int CLoop::m_type = 0;
CLoop::CLoop() {
}
CLoop::CLoop(const TopoDS_Wire &wire) {
m_topods_wire = wire;
m_pface = NULL;
m_is_outer = false;
}
CLoop::~CLoop()
{
}
CEdge* CLoop::GetFirstEdge()
{
if (m_edges.size()==0) return NULL;
m_edgeIt = m_edges.begin();
return *m_edgeIt;
}
CEdge* CLoop::GetNextEdge()
{
if (m_edges.size()==0 || m_edgeIt==m_edges.end()) return NULL;
m_edgeIt++;
if (m_edgeIt==m_edges.end()) return NULL;
return *m_edgeIt;
}
CEdge* CLoop::GetEdge(int index)
{
int i = 0;
for(std::list<CEdge*>::iterator It = m_edges.begin(); It != m_edges.end(); It++, i++)
{
if(index == i)return *It;
}
return NULL;
}