bool GR_DLNodeBody::Update() { GR_DLNodePtrVect* pvDLNode = NULL; GR_DLPtrVect* pvDL = NULL; this->GetChildren(pvDLNode, pvDL); if(pvDL->size() > 0) RemoveDL(pvDL->front()); ASSERT(m_pStBody.GetTarget()); BREP_FacePtrVect vFace; BREP_Util::GetFaces(m_pStBody->GetBody().GetTarget(), vFace); BREP_FacePtrVect::const_iterator it = vFace.begin(); BREP_FacePtrVect::const_iterator itEnd = vFace.end(); for(; it!=itEnd; ++it) { GR_DLSrf* pDLSrf = NEW_OBJ(GR_DLSrf, this)(this, (*it)->GetSrf()); // Add attribute - color pDLSrf->AddAttrib(NEW_OBJ(GR_DLAttribColor, this)(GR_Color(1.0f, 1.0f, 0.0f, 0.3f))); // Add attribute - blend //pDLSrf->AddAttrib(NEW_OBJ(GR_DLAttribBlend, this)(true)); } return true; }
VALUE thread_new() { VALUE thr; thr = NEW_OBJ(Thread); OBJ_SETUP(thr, T_THREAD); BASIC(thr).klass = cThread; vector_push(thr_stk, (void*)thr); THREAD(thr)->alive_p = 1; if (cur_thr) THREAD(thr)->branch = THREAD(cur_thr)->branch; if ((thr != main_thread()) && (thr != cur_thr)) THREAD(thr)->recv = cur_thr; THREAD(thr)->up = cur_thr; THREAD(thr)->env_tbl = st_init_numtable(); THREAD(thr)->obj_stk = vector_new(); THREAD(thr)->self_stk = vector_new(); THREAD(thr)->env_stk = vector_new(); THREAD(thr)->tok_stk = vector_new(); THREAD(thr)->stack = vector_new(); #ifdef SYMBOL_CACHE THREAD(thr)->modified_syms = vector_new(); #endif return thr; }
static ALCbackend* ALCwinmmBackendFactory_createBackend(ALCwinmmBackendFactory* UNUSED(self), ALCdevice *device, ALCbackend_Type type) { if(type == ALCbackend_Playback) { ALCwinmmPlayback *backend; NEW_OBJ(backend, ALCwinmmPlayback)(device); if(!backend) return NULL; return STATIC_CAST(ALCbackend, backend); } if(type == ALCbackend_Capture) { ALCwinmmCapture *backend; NEW_OBJ(backend, ALCwinmmCapture)(device); if(!backend) return NULL; return STATIC_CAST(ALCbackend, backend); } return NULL; }
VALUE float_new(float num) { VALUE obj; obj = NEW_OBJ(Float); OBJ_SETUP(obj, T_FLOAT); BASIC(obj).klass = cFloat; FLOAT(obj)->num = num; return (VALUE)obj; }
VALUE hash_new() { VALUE hash; hash = NEW_OBJ(Hash); OBJ_SETUP(hash, T_HASH); BASIC(hash).klass = cHash; BASIC(hash).reap = hash_reap; HASH(hash)->ptr = st_init_numtable(); return (VALUE)hash; }
// Copy the entity BREP_Loop* BREP_Loop::Copy(const SL_Ptr<BREP_Face>& pFace) { BREP_Loop* pLoop = NEW_OBJ(BREP_Loop, pFace.GetTarget())(pFace); if(pLoop) { BREP_CoEdgePtrVect::const_iterator it = m_vCoEdge.begin(); BREP_CoEdgePtrVect::const_iterator itEnd = m_vCoEdge.end(); for(; it!=itEnd; ++it) { BREP_CoEdge* pCoEdge = dynamic_cast<BREP_CoEdge*>((*it)->Copy(pLoop)); ASSERT(pCoEdge); if(pCoEdge) pLoop->AddCoEdge(pCoEdge); } } return pLoop; }
// Copy the entity BREP_Face* BREP_Face::Copy(const SL_Ptr<BREP_Shell>& pShell) { BREP_Face* pFace = NEW_OBJ(BREP_Face, pShell.GetTarget())(pShell); if(pFace) { BREP_LoopPtrVect::const_iterator it = m_vLoop.begin(); BREP_LoopPtrVect::const_iterator itEnd = m_vLoop.end(); for(; it!=itEnd; ++it) { BREP_Loop* pLoop = (*it)->Copy(pFace); ASSERT(pLoop); if(pLoop) pFace->AddLoop(pLoop); } // Copy the geometry information m_pSrf = pFace->m_pSrf->Copy(); } return pFace; }
// Copy this surface // virtual MH_Srf* MH_SrfBezier::Copy() { MH_SrfBezier* pSrf = NEW_OBJ(MH_SrfBezier, this)(); *pSrf = *this; return pSrf; }
// Copy this surface // virtual MH_Srf* MH_SrfNurbs::Copy() { MH_SrfNurbs* pSrf = NEW_OBJ(MH_SrfNurbs, this)(); *pSrf = *this; return pSrf; }
// Copy this curve // virtual MH_Crv* MH_CrvBezier::Copy() { MH_CrvBezier* pCrv = NEW_OBJ(MH_CrvBezier, this)(); *pCrv = *this; return pCrv; }
// Copy this curve // virtual MH_Crv* MH_CrvRay::Copy() { MH_CrvRay* pCrv = NEW_OBJ(MH_CrvRay, this)(); *pCrv = *this; return pCrv; }
// Copy the entity BREP_Edge* BREP_Edge::Copy(const SL_Ptr<BREP_CoEdge>& pCoEdge) { return NEW_OBJ(BREP_Edge, pCoEdge.GetTarget())(pCoEdge); }
// virtual HRESULT S2_CrvLineSegReq::OnExecute() { HRESULT hr = S_OK; // Copy the geometry expression MH_CrvLineSeg* pCrvLineSeg = NEW_OBJ(MH_CrvLineSeg, m_DLNodeSketch2D)(m_CrvLineSeg); ASSERT(pCrvLineSeg); MH_Point3* pPtFrom = NEW_OBJ(MH_Point3, pCrvLineSeg)(pCrvLineSeg->GetFrom()); ASSERT(pPtFrom); MH_Point3* pPtTo = NEW_OBJ(MH_Point3, pCrvLineSeg)(pCrvLineSeg->GetTo()); ASSERT(pPtTo); // Create the DLCrv GR_DLCrv* pDLCrv = NEW_OBJ(GR_DLCrv, m_DLNodeSketch2D)(m_DLNodeSketch2D, pCrvLineSeg); ASSERT(pDLCrv); pDLCrv->SetColor(GR_Color(0,1.0f,0,0)); // Create from-DLPoint GR_DLPoint* pDLPointFrom = NEW_OBJ(GR_DLPoint, m_DLNodeSketch2D)(m_DLNodeSketch2D, pPtFrom); ASSERT(pDLPointFrom); // Create to-DLPoint GR_DLPoint* pDLPointTo = NEW_OBJ(GR_DLPoint, m_DLNodeSketch2D)(m_DLNodeSketch2D, pPtTo); ASSERT(pDLPointTo); DR_StCrvLineSeg* pStCrvLineSeg = NEW_OBJ(DR_StCrvLineSeg, m_pDoc->GetFragment())(m_pDoc->GetFragment(), *pCrvLineSeg); ASSERT(pStCrvLineSeg); m_DLNodeSketch2D->GetDCtSketch2D()->AddInput(pStCrvLineSeg); DR_StPoint* pStPointFrom = NEW_OBJ(DR_StPoint, m_pDoc->GetFragment())(m_pDoc->GetFragment(), pCrvLineSeg->GetFrom()); ASSERT(pStPointFrom); m_DLNodeSketch2D->GetDCtSketch2D()->AddInput(pStPointFrom); DR_StPoint* pStPointTo = NEW_OBJ(DR_StPoint, m_pDoc->GetFragment())(m_pDoc->GetFragment(), pCrvLineSeg->GetTo()); ASSERT(pStPointTo); m_DLNodeSketch2D->GetDCtSketch2D()->AddInput(pStPointTo); // Update the map m_DLNodeSketch2D->Add(pStCrvLineSeg, pDLCrv); m_DLNodeSketch2D->Add(pStPointFrom, pDLPointFrom); m_DLNodeSketch2D->Add(pStPointTo, pDLPointTo); // Create constraints DR_DCtSolver* pDCtSolver = NEW_OBJ(DR_DCtSolver, m_pDoc->GetFragment())(m_pDoc->GetFragment()); ASSERT(pDCtSolver); pDCtSolver->AddOutput(pStPointFrom); pDCtSolver->AddOutput(pStPointTo); pDCtSolver->AddOutput(pStCrvLineSeg); DR_UCtPointLineSeg* pUCtPointLineSeg = NEW_OBJ(DR_UCtPointLineSeg, m_pDoc->GetFragment())(pDCtSolver, pStPointFrom, pStCrvLineSeg); ASSERT(pUCtPointLineSeg); pUCtPointLineSeg = NEW_OBJ(DR_UCtPointLineSeg, m_pDoc->GetFragment())(pDCtSolver, pStPointTo, pStCrvLineSeg); ASSERT(pUCtPointLineSeg); return hr; }