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


C++ Solid类代码示例

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


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

示例1: GetDocument

void MagicView::OnUpdateTextureMap(CCmdUI* pCmdUI) 
{
   Solid*      solid = GetDocument()->GetSolid();
   Selection*  seln  = GetDocument()->GetSelection();

   pCmdUI->Enable(solid && solid->GetModel() && seln && seln->GetPolys().size() > 0);
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:7,代码来源:MagicView.cpp

示例2: visit

void ForceValidityVisitor::visit( Solid& g )
{
    g.forceValidityFlag( valid_ );
    for ( size_t i = 0; i < g.numShells(); i++ ) {
        visit( g.shellN( i ) );
    }
}
开发者ID:Ezio47,项目名称:SFCGAL,代码行数:7,代码来源:ForceValidityVisitor.cpp

示例3: dlg

void MagicView::OnTextureMap() 
{
   TextureMapDialog dlg(this);
   if (dlg.DoModal() == IDOK) {
      MagicDoc*   doc      = GetDocument();
      Solid*      solid    = doc->GetSolid();
      Selection*  seln     = doc->GetSelection();
      Selector*   selector = doc->GetSelector();
      Editor*     editor   = doc->GetEditor();
      Material*   mtl      = 0;

      if (dlg.mMaterialIndex >= 0) {
         mtl = &solid->GetModel()->GetMaterials()[dlg.mMaterialIndex];
      }

      editor->UseModel(solid->GetModel());
      editor->ApplyMaterial(mtl, seln->GetPolys(),
                      dlg.mMapType, 2-dlg.mAxis, (float) dlg.mScaleU, (float) dlg.mScaleV,
                      dlg.mFlip, dlg.mMirror, dlg.mRotate);

      selector->Reselect();

      Invalidate();
      doc->SetModifiedFlag(TRUE);
      doc->UpdateAllViews(this);
   }
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:27,代码来源:MagicView.cpp

示例4: FindPoints

void SingularPoint :: FindPoints (class Mesh & mesh)
{
  points.SetSize(0);
  ARRAY<int> surfk, surf;


  for (PointIndex pi = PointIndex::BASE; 
       pi < mesh.GetNP()+PointIndex::BASE; pi++)
    {
      if (mesh[pi].Type() != FIXEDPOINT) continue;
      const Point<3> p = mesh[pi];

      (*testout) << "check singular point" << p << endl;

      if (sol1->IsIn (p) && sol2->IsIn(p) && sol3->IsIn(p) &&
	  !sol1->IsStrictIn (p) && !sol2->IsStrictIn(p) && !sol3->IsStrictIn(p))
	{
	  surf.SetSize (0);
	  for (int k = 1; k <= 3; k++)
	    {
	      const Solid * solk;
	      Solid *tansol;
	      switch (k)
		{
		case 1:  solk = sol1; break;
		case 2:  solk = sol2; break;
		case 3:  solk = sol3; break;
		}

	      solk -> TangentialSolid (p, tansol, surfk, 1e-3);
	      (*testout) << "Tansol = " << *tansol << endl;

	      if (!tansol) continue;

	      ReducePrimitiveIterator rpi(Box<3> (p-Vec<3> (1e-3,1e-3,1e-3),
						  p+Vec<3> (1e-3,1e-3,1e-3)));
	      UnReducePrimitiveIterator urpi;
	      
	      tansol -> IterateSolid (rpi);
	      tansol->GetSurfaceIndices (surfk);
	      tansol -> IterateSolid (urpi);

	      (*testout) << "surfinds = " << surfk << endl;

	      for (int i = 0; i < surfk.Size(); i++)
		if (!surf.Contains (surfk[i]))
		  surf.Append (surfk[i]);
	      
	      delete tansol;
	    }

	  if (surf.Size() < 3) continue;

	  points.Append (p);
	  PrintMessage (5, "Point (", p(0), ", ", p(1), ", ", p(2), ") is singular");
	  mesh[pi].Singularity(factor);
	}
    }  
}
开发者ID:AlexanderToifl,项目名称:viennamesh-dev,代码行数:59,代码来源:singularref.cpp

示例5: transform

void AffineTransform3::transform( Solid& solid )
{
    transform( solid.exteriorShell() );

    for ( size_t i = 0; i < solid.numInteriorShells(); ++i ) {
        transform( solid.interiorShellN( i ) );
    }
}
开发者ID:Ezio47,项目名称:SFCGAL,代码行数:8,代码来源:AffineTransform3.cpp

示例6:

// Compare two solids by volume using <=
bool operator<=( const Solid& lhs, const Solid& rhs )
{
    if( lhs.volume() <= rhs.volume() ) {
        return true;
    } else {
        return false;
    }
}
开发者ID:DArtagan,项目名称:C--,代码行数:9,代码来源:Solid.cpp

示例7: triangulatePolygon3D

void triangulatePolygon3D(
    const Solid& g,
    TriangulatedSurface& triangulatedSurface
)
{
    for ( size_t i = 0; i < g.numShells(); i++ ) {
        triangulatePolygon3D( g.shellN( i ), triangulatedSurface );
    }
}
开发者ID:HEShuang,项目名称:SFCGAL,代码行数:9,代码来源:triangulatePolygon.cpp

示例8: Solid

	// generate a solid at the point p
	// the solid has a vertex, a face, a loop but no edges
	Solid* Solid::mvfs(Vertex* newv)
	{
		Solid *s = new Solid();
		Face *newf = new Face(s);
		Loop* newl = new Loop();
		s->addVertex(newv);
		s->addFace(newf);
		newf->addLoop(newl);

		return s;
	}
开发者ID:liminchen,项目名称:VirtualStudio,代码行数:13,代码来源:cad2d.cpp

示例9: Render

void CSGWorld::Render()
{
	for(int i = 0; i < m_Solids.size(); i++)
	{
		Solid * pSolid = m_Solids[i];

		if(m_RenderSwitchboard[i])
		{
			pSolid->Render();
		}
	}
}
开发者ID:andreaswatch,项目名称:dizuo,代码行数:12,代码来源:CSGWorld.cpp

示例10: Collide

int Group::Collide(Solid& moving) const
{
  if (!GetBoundingSphere().Collide(moving.GetBoundingSphere())) return 0;
  if (!GetBoundingBox().Collide(moving.GetBoundingBox())) return 0; 

  for (int i=0; i < GetCard() ; i++) {
    Solid* other=group[i];
    if (other==&moving) continue;
    if (!other->GetBoundingSphere().Collide(moving.GetBoundingSphere())) continue;
    if (!other->GetBoundingBox().Collide(moving.GetBoundingBox())) continue;
    return 1;
  }
  return 0;
}
开发者ID:philippedax,项目名称:vreng,代码行数:14,代码来源:group.cpp

示例11: Solid

/// Create a solid shape using the plugin mechanism from the attributes of the XML element
Solid dd4hep::xml::createShape(Detector& description,
                               const std::string& shape_type,
                               xml::Element element)   {
  string fac  = shape_type + "__shape_constructor";
  xml::Handle_t solid_elt = element;
  Solid solid = Solid(PluginService::Create<TObject*>(fac, &description, &solid_elt));
  if ( !solid.isValid() )  {
    PluginDebug dbg;
    PluginService::Create<TObject*>(fac, &description, &solid_elt);
    except("xml::createShape","Failed to create solid of type %s [%s]", 
           shape_type.c_str(),dbg.missingFactory(shape_type).c_str());
  }
  return solid;
}
开发者ID:AIDASoft,项目名称:DD4hep,代码行数:15,代码来源:Utilities.cpp

示例12: assert

Solid * BlueprintInstance::detachSolid(unsigned int i)
{
    assert(i < mSolidList.size());
    Solid * detached = mSolidList[i];

    // detach from list
    mSolidList.erase(mSolidList.begin() + i);

    // detach from map
    map<string, Solid*>::iterator iter =
        mSolidMap.find(detached->getName());
    mSolidMap.erase(iter);

    return detached;
}
开发者ID:sub77,项目名称:hobbycode,代码行数:15,代码来源:BlueprintInstance.cpp

示例13: create

        static Target create( const Option& o )
        {

            Solid* solid = new Solid( &o );
            TargetValue* THIS = new TargetValue( solid );
            solid->setTHIS(THIS);

            Target target = THIS;

            solid->build(o);

            //l.addFeature( target );

            return Target(target);
        }
开发者ID:anylonen,项目名称:abura-tan,代码行数:15,代码来源:features.hpp

示例14: distanceTriangleSolid3D

double distanceTriangleSolid3D( const Triangle& gA, const Solid& gB )
{
    if ( gA.isEmpty() || gB.isEmpty() ) {
        return std::numeric_limits< double >::infinity() ;
    }

    if ( intersects3D( gA, gB, NoValidityCheck() ) ) {
        return 0.0 ;
    }

    double dMin = std::numeric_limits< double >::infinity() ;

    for ( size_t i = 0; i < gB.numShells(); i++ ) {
        dMin = std::min( dMin, gB.shellN( i ).distance3D( gA ) );
    }

    return dMin ;
}
开发者ID:Oslandia,项目名称:SFCGAL,代码行数:18,代码来源:distance3d.cpp

示例15: distancePointSolid3D

double distancePointSolid3D( const Point& gA, const Solid& gB )
{
    if ( gA.isEmpty() || gB.isEmpty() ) {
        return std::numeric_limits< double >::infinity() ;
    }

    if ( intersects3D( gA, gB, NoValidityCheck() ) ) {
        return 0.0 ;
    }

    double dMin = std::numeric_limits< double >::infinity() ;

    for ( size_t i = 0; i < gB.numShells(); i++ ) {
        dMin = std::min( dMin, distanceGeometryCollectionToGeometry3D( gB.shellN( i ), gA ) );
    }

    return dMin ;
}
开发者ID:Oslandia,项目名称:SFCGAL,代码行数:18,代码来源:distance3d.cpp


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