本文整理汇总了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);
}
示例2: visit
void ForceValidityVisitor::visit( Solid& g )
{
g.forceValidityFlag( valid_ );
for ( size_t i = 0; i < g.numShells(); i++ ) {
visit( g.shellN( i ) );
}
}
示例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);
}
}
示例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);
}
}
}
示例5: transform
void AffineTransform3::transform( Solid& solid )
{
transform( solid.exteriorShell() );
for ( size_t i = 0; i < solid.numInteriorShells(); ++i ) {
transform( solid.interiorShellN( i ) );
}
}
示例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;
}
}
示例7: triangulatePolygon3D
void triangulatePolygon3D(
const Solid& g,
TriangulatedSurface& triangulatedSurface
)
{
for ( size_t i = 0; i < g.numShells(); i++ ) {
triangulatePolygon3D( g.shellN( i ), triangulatedSurface );
}
}
示例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;
}
示例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();
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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 ;
}
示例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 ;
}