layer.cpp

来自「我自己写的代码 可能比较简单 我实现了模拟图层的功能」· C++ 代码 · 共 69 行

CPP
69
字号
///////////////////////////////////////////////////////////
//  Layer.cpp
//  Implementation of the Class Layer
//  Created on:      18-二月-2009 17:17:32
//  Original author: pangyj
///////////////////////////////////////////////////////////
#include "StdAfx.h"

#include "Layer.h"


Layer::Layer():EntityObject(),cName(NULL){
	iTypeFlag = tLayer;
}
Layer::Layer(const char * name):EntityObject()
{
	cName = strdup(name);
	iTypeFlag = tLayer;
}
void Layer::erase()
{
	lit_node<unsigned long> * pCureNode = lSubEntities.get_head();
	while (pCureNode)
	{
		curModelSpace()->erase(pCureNode->get_value());
		pCureNode = pCureNode->next();
	}
}
Layer::~Layer(){

}
bool Layer::hasIt(unsigned long id){
	if (lSubEntities.findValue(id))
	{
		return true;
	}
	return false;
}


ErrorStatus Layer::name(const char* sname){

	if (sname)
	{
		strcpy(cName,sname);
	}
	return  eOk;
}


char* Layer::name()const{

	return  cName;
}
void Layer::list()const
{
	cout<<"========================="<<endl;
	cout<<"type=Layer  ";
	printf("name=%s\n",cName);
	lit_node<unsigned long> * pCurNode = lSubEntities.get_head();
	printf("there are %d entities on this layer,they are:\n",lSubEntities.count());
	EntityObject::list();
	int i = 0;
	while (pCurNode)
	{
		printf("%d->id=%d\n",i,pCurNode->get_value());
		pCurNode = pCurNode->next();
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?