当前位置: 首页>>代码示例>>C++>>正文


C++ Face类代码示例

本文整理汇总了C++中Face的典型用法代码示例。如果您正苦于以下问题:C++ Face类的具体用法?C++ Face怎么用?C++ Face使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Face类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: visit

 void visit(Face& face) const
 {
   if(!m_done)
   {
     m_done = true;
     FaceTexdef_getTexdef(face.getTexdef(), m_projection);
   }
 }
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:8,代码来源:brushmanip.cpp

示例2: NFD_LOG_DEBUG

void
Forwarder::onDataUnsolicited(Face& inFace, const Data& data)
{
  // accept to cache?
  bool acceptToCache = inFace.isLocal();
  if (acceptToCache) {
    // CS insert
    if (m_csFromNdnSim == nullptr)
      m_cs.insert(data, true);
    else
      m_csFromNdnSim->Add(data.shared_from_this());
  }

  NFD_LOG_DEBUG("onDataUnsolicited face=" << inFace.getId() <<
                " data=" << data.getName() <<
                (acceptToCache ? " cached" : " not cached"));
}
开发者ID:ljjgithub,项目名称:ndnSIM,代码行数:17,代码来源:forwarder.cpp

示例3: face1

// Morph two faces
// --morphfaces <targa filename1> <targa filename2> <eigenfaces filename> <distance (0.0=first, 1.0=second, in between is a morph)> <outfile name>
void Main::morphFaces()
{
	std::string filename1=args.nextArg();
	std::string filename2=args.nextArg();
	std::string eigfilename=args.nextArg();
	double distance = args.nextFloat();
	std::string outfilename=args.nextArg();
	EigFaces eigenfaces;
	eigenfaces.load(eigfilename);
	Face face1(eigenfaces.getWidth(), eigenfaces.getHeight());
	Face face2(eigenfaces.getWidth(), eigenfaces.getHeight());
	Face result;
	face1.loadTarga(filename1);
	face2.loadTarga(filename2);
	eigenfaces.morphFaces(face1, face2, distance, result);
	result.saveTarga(outfilename);
}
开发者ID:andrewhannebrink,项目名称:Facial-Recognition,代码行数:19,代码来源:main.cpp

示例4: Delaunay

	Delaunay(float* points, int pointslen) {
		this->points = points;
		this->pointslen = pointslen;
		//查找点集最大最小值
		float xa, xi, ya, yi;
		xa = points[0];
		xi = points[0];
		ya = points[1];
		yi = points[1];
		for (int i = 0; i < pointslen; i++) {
			float x = points[i * 2];
			float y = points[i * 2 + 1];
			xa = xa < x ? x : xa;
			xi = xi > x ? x : xi;
			ya = ya < y ? y : ya;
			yi = yi > y ? y : yi;
		}
		//构造初始三角网
		Face* fistA = new Face();
		Face* fistB = new Face();
		faceList = fistA;
		fistA->next = fistB;
		fistA->setPoint0(xi, yi); //-1
		fistA->setPoint1(xa, yi); //-2
		fistA->setPoint2(xi, ya); //-3
		fistB->setPoint0(xa, yi); //-2
		fistB->setPoint1(xi, ya); //-3
		fistB->setPoint2(xa, ya); //-4
		fistB->next = 0;
		fistA->pointindex[0] = -1;
		fistA->pointindex[1] = -2;
		fistA->pointindex[2] = -3;
		fistB->pointindex[0] = -2;
		fistB->pointindex[1] = -3;
		fistB->pointindex[2] = -4;
		//初始化lop条件
		fistA->edgeFaces[1] = new EdgeFace(fistB, 2);
		fistB->edgeFaces[0] = new EdgeFace(fistA, 0);
		fistA->lop();
		fistB->lop();
		for(int i=0;i<pointslen;i++){
			float* fp=&points[i*2];
			insert(fp);
		}
	}
开发者ID:tjns8,项目名称:face,代码行数:45,代码来源:lawson.hpp

示例5: lop

	void lop() {
		//前提条件,三点顺序在所有三角形中都是顺时针
		//提供的两个三角形必须相邻,且index必须已经被赋值
		for (int i = 0; i < 3; i++) {
			if (edgeFaces[i] == 0)
				continue;
			if (!isInCircle(edgeFaces[i]->getOtherPoint()))
				continue;
			//需要进行变换
			Face* b = edgeFaces[i]->face;
			int bo = edgeFaces[i]->otherPointIndex; //b中的外点
			Face* a = this;
			int ao = i - 1 >= 0 ? i - 1 : 2; //a中的外点
			int la1 = i; //a共线端点
			int la2 = i + 1 >= 3 ? 0 : i + 1; //a共线端点
			int lb1 = bo + 1 >= 3 ? 0 : bo + 1; //b共线端点
			int lb2 = lb1 + 1 >= 3 ? 0 : lb1 + 1; //b共线端点
			a->setPoint(la2, b->getPoint(bo));
			b->setPoint(lb2, a->getPoint(ao));
			a->edgeFaces[la1]->set(b->edgeFaces[lb2]);
			a->edgeFaces[la1]->updateOtherFaceForMyEdgeFaceInfo(ao, a);
			b->edgeFaces[lb1]->set(a->edgeFaces[la2]);
			b->edgeFaces[lb1]->updateOtherFaceForMyEdgeFaceInfo(bo, b);
			a->edgeFaces[la2]->face = b;
			a->edgeFaces[la2]->otherPointIndex = lb1;
			b->edgeFaces[lb2]->face = a;
			b->edgeFaces[lb2]->otherPointIndex = la1;
			//变换结束后,原三角形的la1不变
			i = 0; //重新处理,直到所有相邻三角形都满足lop
			b->lop();
		}
	}
开发者ID:tjns8,项目名称:face,代码行数:32,代码来源:lawson.hpp

示例6: viiRelatedFaces

void Mesh::calculateVII(float radius)
{
	for(std::set<Vertex*>::iterator j=this->mVertices.begin();j!=this->mVertices.end();j++)
	{
		Vertex* vertex = *j;
		float Br = (4/3)*PI*radius;  
		float Vl = 0.0f;
		float Vp = 0.0f;	
		std::set<Face*> catA,catB,catC;
		viiRelatedFaces(vertex,radius,catA,catB,catC);
		
		//Vp ungenau momentan. toDo: genauer
		for(std::set<Face*>::iterator i = catA.begin();i!=catA.end();i++)
		{
			Face* face = *i;
			Vector3 vecA = face->getA()->getPosition();
			Vector3 vecB = face->getB()->getPosition();
			Vector3 vecC = face->getC()->getPosition();
			vecA.setY(0);
			vecB.setY(0);
			vecC.setY(0);
			Vector3 area = (vecB-vecA).crossProduct(vecC-vecA);
			float aj = area.getLength() / 2;
			Vector3 s = face->getA()->getPosition() + face->getB()->getPosition() + face->getC()->getPosition();
			s /= 3;
			
			Vp += s.getY() * aj;
			
			//Vp += s.getY();
		}
		
		float volumeIntegralInvariant = Vl+Vp+(Br/2);
	}
}
开发者ID:GFHund,项目名称:LII,代码行数:34,代码来源:Mesh.cpp

示例7: removeFace

 void Mesh::collapse(Vertex* v1, Vertex* v2)
 {
     std::vector<Face*>::iterator i;
     for (i = v1->adjacentFaces().begin(); i != v1->adjacentFaces().end(); ++i){
         Face* f = *i;
         if (f->hasVertex(v2)) {
             removeFace(f);
             // delete f;
         }
     }
     
     Vector3 position1 = v1->position();
     int weight1 = v1->weight();
     Vector3 position2 = v2->position();
     int weight2 = v2->weight();
     
     Vector3 newPosition = (position1 * weight1 + position2 * weight2) / (weight1 + weight2);
     
     v2->setPosition(newPosition);
     v2->setWeight(v1->weight() + v2->weight());
     
     for (i = v1->adjacentFaces().begin(); i != v1->adjacentFaces().end(); ++i){
         Face* f = *i;
         f->changeVertex(v1, v2);
         f->calculateNormal();
     }
     
     std::vector<Vertex*>::iterator j;
     for (j = v1->adjacentVertices().begin(); j != v1->adjacentVertices().end(); ++j){
         Vertex* v = *j;
         v->removeAdjacentVertex(v1);
         v->addAdjacentVertex(v2);
         Edge* e = getEdge(v1, v);
         if (e) {
             if (e->hasVertex(v2)) {
                 removeEdge(e);
                 //delete e; // FIXME: pointer being freed was not allocated
             } else {
                 e->changeVertex(v1, v2);
             }
         } else {
             std::cerr << "missing edge" << v1->index() << "/" << v->index() << "\n";
         }
     }
 }
开发者ID:keishi,项目名称:Degas,代码行数:45,代码来源:Mesh.cpp

示例8: splitFace

        Vec3f Brush::splitFace(const FaceInfo& faceInfo, const Vec3f& delta) {
            FaceSet newFaces;
            FaceSet droppedFaces;

            Vec3f newVertexPosition = m_geometry->splitFace(m_worldBounds, faceInfo, delta, newFaces, droppedFaces);

            for (FaceSet::iterator it = droppedFaces.begin(); it != droppedFaces.end(); ++it) {
                Face* dropFace = *it;
                dropFace->setBrush(NULL);
                m_faces.erase(std::remove(m_faces.begin(), m_faces.end(), dropFace), m_faces.end());
                delete dropFace;
            }

            for (FaceList::iterator it = m_faces.begin(); it != m_faces.end(); ++it) {
                Face* face = *it;
                face->invalidateTexAxes();
                face->invalidateVertexCache();
            }

            for (FaceSet::iterator it = newFaces.begin(); it != newFaces.end(); ++it) {
                Face* newFace = *it;
                newFace->setBrush(this);
                m_faces.push_back(newFace);
            }

            setNeedsRebuild(true);
            
            return newVertexPosition;
        }
开发者ID:WakaLakaLake,项目名称:TrenchBroom,代码行数:29,代码来源:Brush.cpp

示例9: assign_kuv_to_edge

	int superMi::assign_kuv_to_edge(Solid* mesh)
	{
		for (SolidEdgeIterator seiter(mesh); !seiter.end(); ++seiter){
			Edge* se = *seiter;
			se->kuv_h() = 0.0;
			//Point p1 = mesh->edgeVertex1(se)->point();
			//Point p3 = mesh->edgeVertex2(se)->point();

			//HalfEdge* he2 = se->halfedge(0)->ccw_rotate_about_source();
			//HalfEdge* he4 = se->halfedge(0)->clw_rotate_about_source();

			//Point p2 = he2->target()->point();
			//Point p4 = he4->target()->point();

			//double alpha =  ((p3 - p2)*(p1 - p2) / ((p3 - p2) ^ (p1 - p2)).norm()) / 2.0;
			//double beta =  ((p3 - p4)*(p1 - p4) / ((p3 - p4) ^ (p1 - p4)).norm()) / 2.0;

			//se->kuv_h() = alpha + beta;

			HalfEdge* he = se->halfedge(0);
			HalfEdge* nhe = he->he_next();
			HalfEdge* phe = he->he_prev();
			Face* hef = he->face();

			double nhel = (nhe->target()->point() - nhe->source()->point()).norm();
			double phel = (phe->target()->point() - phe->source()->point()).norm();
			double hel = (he->target()->point() - he->source()->point()).norm();

			se->kuv_h() += (nhel*nhel + phel*phel - hel*hel) / hef->area() / 8.0;

			he = se->halfedge(1);
			nhe = he->he_next();
			phe = he->he_prev();
			hef = he->face();
			nhel = (nhe->target()->point() - nhe->source()->point()).norm();
			phel = (phe->target()->point() - phe->source()->point()).norm();

			se->kuv_h() += (nhel*nhel + phel*phel - hel*hel) / hef->area() / 8.0;

			se->kuv_t() = 1.0;
			//std::cout << se->kuv() << std::endl;
		}

		return 0;
	}
开发者ID:icemiliang,项目名称:CSE570,代码行数:45,代码来源:superMi.cpp

示例10: setNeedsRebuild

        FaceInfoList Brush::moveFaces(const FaceInfoList& faceInfos, const Vec3f& delta) {
            FaceSet newFaces;
            FaceSet droppedFaces;

            const FaceInfoList newFaceInfos = m_geometry->moveFaces(m_worldBounds, faceInfos, delta, newFaces, droppedFaces);

            for (FaceSet::iterator it = droppedFaces.begin(); it != droppedFaces.end(); ++it) {
                Face* face = *it;
                face->setBrush(NULL);
                m_faces.erase(std::remove(m_faces.begin(), m_faces.end(), face), m_faces.end());
                delete face;
            }

            for (FaceList::iterator it = m_faces.begin(); it != m_faces.end(); ++it) {
                Face* face = *it;
                face->invalidateTexAxes();
                face->invalidateVertexCache();
            }

            for (FaceSet::iterator it = newFaces.begin(); it != newFaces.end(); ++it) {
                Face* face = *it;
                face->setBrush(this);
                m_faces.push_back(face);
            }
            
            setNeedsRebuild(true);

            return newFaceInfos;
        }
开发者ID:WakaLakaLake,项目名称:TrenchBroom,代码行数:29,代码来源:Brush.cpp

示例11: FakeFace

Face *Carriers::listen(const Contact& address) {
    // for now, only TcpFace exists - otherwise would need to manage
    // multiple possibilities
    //YARP_DEBUG(carriersLog,"listen called");
    Face *face = NULL;
    if (address.getCarrier() == "fake") {
        face = new FakeFace();
    }
    if (face == NULL) {
        face = new TcpFace();
    }
    bool ok = face->open(address);
    if (!ok) {
        delete face;
        face = NULL;
    }
    return face;
}
开发者ID:elen4,项目名称:yarp,代码行数:18,代码来源:Carriers.cpp

示例12: do_tesselate_face

bool do_tesselate_face( const Face &F, tesscb_estimator* cb_E, int &max_id )
{
	if (F.CalcArea()<EPS_L)	
		return false;//continue;
	max_id				= cb_E(&F);
	if		(max_id<0)		
		return false;//continue;	// nothing selected
	return true;
}
开发者ID:2asoft,项目名称:xray,代码行数:9,代码来源:xrPhase_AdaptiveHT.cpp

示例13: sendInterest

 virtual void
 sendInterest(const shared_ptr<pit::Entry>& pitEntry,
              Face& outFace,
              bool wantNewNonce = false) override
 {
   sendInterestHistory.push_back({pitEntry->getInterest(), outFace.getId(), wantNewNonce});
   pitEntry->insertOrUpdateOutRecord(outFace, pitEntry->getInterest());
   afterAction();
 }
开发者ID:eric135,项目名称:NFD,代码行数:9,代码来源:strategy-tester.hpp

示例14: NFD_LOG_DEBUG

void
Forwarder::onInterestLoop(Face& inFace, const Interest& interest,
                          shared_ptr<pit::Entry> pitEntry)
{
  NFD_LOG_DEBUG("onInterestLoop face=" << inFace.getId() <<
                " interest=" << interest.getName());

  // (drop)
}
开发者ID:chris-wood,项目名称:onpath-NFD,代码行数:9,代码来源:forwarder.cpp

示例15: NFD_LOG_DEBUG

void
Strategy::afterContentStoreHit(const shared_ptr<pit::Entry>& pitEntry,
                               const Face& inFace, const Data& data)
{
  NFD_LOG_DEBUG("afterContentStoreHit pitEntry=" << pitEntry->getName() <<
                " inFace=" << inFace.getId() << " data=" << data.getName());

  this->sendData(pitEntry, data, inFace);
}
开发者ID:cawka,项目名称:NFD,代码行数:9,代码来源:strategy.cpp


注:本文中的Face类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。