本文整理汇总了C++中HeeksObj类的典型用法代码示例。如果您正苦于以下问题:C++ HeeksObj类的具体用法?C++ HeeksObj怎么用?C++ HeeksObj使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HeeksObj类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsCircle
bool CSketch::IsCircle()const
{
if (m_objects.size() == 1)
{
return m_objects.front()->GetType() == CircleType;
}
if (m_objects.size() > 1)
{
if (m_objects.front()->GetType() != ArcType)
return false;
HArc* reference_arc = (HArc*)(m_objects.front());
gp_Circ reference_circle = reference_arc->GetCircle();
for (std::list<HeeksObj*>::const_iterator It = m_objects.begin(); It != m_objects.end(); It++)
{
HeeksObj* span = *It;
if (span->GetType() != ArcType)
return false;
HArc* arc = (HArc*)span;
gp_Circ circle = arc->GetCircle();
if (fabs(circle.Radius() - reference_circle.Radius()) > wxGetApp().m_geom_tol)
return false;
if (!circle.Axis().Direction().IsEqual(reference_circle.Axis().Direction(), 0.01))
return false;
}
return true;
}
return false;
}
示例2: CreateRuledFromSketches
HeeksObj* CreateRuledFromSketches(std::list<HeeksObj*> list, bool make_solid)
{
std::list<TopoDS_Wire> wire_list;
for(std::list<HeeksObj *>::iterator It = list.begin(); It != list.end(); It++)
{
HeeksObj* object = *It;
if(object->GetType() == SketchType)
{
std::list<HeeksObj*> s;
s.push_back(object);
TopoDS_Wire wire;
if(ConvertLineArcsToWire2(s, wire))
{
wire_list.push_back(wire);
}
}
}
TopoDS_Shape shape;
if(CreateRuledSurface(wire_list, shape, make_solid))
{
return CShape::MakeObject(shape, _("Ruled Surface"), SOLID_TYPE_UNKNOWN, HeeksColor(51, 45, 51), 1.0f);
}
return NULL;
}
示例3: GetSketchMenuTools
void GetSketchMenuTools(std::list<Tool*>* t_list){
int count=0;
bool gotsketch=false;
bool gotpart=false;
// check to see what types have been marked
std::list<HeeksObj*>::const_iterator It;
for(It = wxGetApp().m_marked_list->list().begin(); It != wxGetApp().m_marked_list->list().end(); It++){
HeeksObj* object = *It;
if(object->GetType() == SketchType)
gotsketch=true;
if(object->GetType() == PartType)
gotpart=true;
count++;
}
if (gotsketch)
{
t_list->push_back(&simplify_sketch_tool);
t_list->push_back(&simplify_sketch_to_bsplines_tool);
// t_list->push_back(&fix_wire); /* This is not ready yet */
}
if(count == 2 && gotsketch && gotpart)
t_list->push_back(&add_to_part);
if(count!=1 || !gotsketch)
return;
t_list->push_back(&pad_sketch);
t_list->push_back(&pocket_sketch);
t_list->push_back(&make_to_part);
}
示例4: CommonShapes
HeeksObj* CShape::CommonShapes(std::list<HeeksObj*> &list_in)
{
// find common solid ( intersect ) with the first one in the list all the others
HeeksObj* s1 = NULL;
bool s1_set = false;
std::list<HeeksObj*> list = list_in;
for(std::list<HeeksObj*>::const_iterator It = list.begin(); It != list.end(); It++){
HeeksObj* object = *It;
if(object->GetType() == SolidType || object->GetType() == FaceType)
{
if(!s1_set)
{
s1 = object;
s1_set = true;
}
else{
s1 = Common(s1, object);
}
}
}
wxGetApp().Repaint();
return s1;
}
示例5: CFixtures
/**
Augment my list of child CFixture objects with any found in the CFixtures (children)
passed in.
*/
void CFixtures::CopyFrom(const HeeksObj* object)
{
if (object->GetType() == GetType())
{
for (HeeksObj *child = ((HeeksObj *) object)->GetFirstChild(); child != NULL; child = ((HeeksObj *) object)->GetNextChild())
{
if (child->GetType() == FixtureType)
{
bool found = false;
for (HeeksObj *mine = GetFirstChild(); ((mine != NULL) && (! found)); mine = GetNextChild())
{
if (mine->GetType() == FixtureType)
{
if (((*(CFixture *) mine)) == (*((CFixture *) child)))
{
found = true;
break;
} // End if - then
} // End if - then
} // End for
if (! found)
{
Add( child, NULL );
} // End if - then
} // End if - then
} // End for
} // End if - then
}
示例6: ReverseObject
void CSketch::ReverseSketch()
{
if(m_objects.size() == 0)return;
std::list<HeeksObj*> new_list;
std::list<HeeksObj*> old_list = m_objects;
for(std::list<HeeksObj*>::iterator It=m_objects.begin(); It!=m_objects.end() ;It++)
{
HeeksObj* object = *It;
HeeksObj* copy = object->MakeACopy();
ReverseObject(copy);
new_list.push_front(copy);
}
Clear();
for(std::list<HeeksObj*>::iterator It = new_list.begin(); It != new_list.end(); It++)
{
HeeksObj* object = *It;
Add(object, NULL);
}
//TODO: this is a hack. Must call remove before add, or else add has no effect. Why are we calling this here?
wxGetApp().ObserversOnChange(NULL,&old_list,NULL);
wxGetApp().ObserversOnChange(&new_list,NULL,NULL);
}
示例7: Run
void Run()
{
CBox bounding_box;
for (HeeksObj *object = m_pThis->GetFirstChild(); object != NULL; object = m_pThis->GetNextChild())
{
object->GetBox(bounding_box);
}
// add tool radius all around the box
if(bounding_box.m_valid)
{
CTool *pTool = CTool::Find(m_pThis->m_tool_number);
if(pTool)
{
double extra = pTool->m_params.m_diameter/2 + 0.01;
bounding_box.m_x[0] -= extra;
bounding_box.m_x[1] -= extra;
bounding_box.m_x[3] += extra;
bounding_box.m_x[4] += extra;
}
}
m_pThis->m_params.m_box = bounding_box;
m_pThis->SetDepthOpParamsFromBox();
}
示例8: ConvertToFaceOrWire
void ConvertToFaceOrWire(std::list<HeeksObj*> list, std::list<TopoDS_Shape> &faces_or_wires, bool face_not_wire)
{
std::list<HeeksObj*> sketches_or_faces_to_delete;
for(std::list<HeeksObj *>::const_iterator It = list.begin(); It != list.end(); It++)
{
HeeksObj* object = *It;
switch(object->GetType())
{
case SketchType:
case CircleType:
{
if(ConvertSketchToFaceOrWire(object, faces_or_wires, face_not_wire))
{
if(wxGetApp().m_extrude_removes_sketches)sketches_or_faces_to_delete.push_back(object);
}
}
break;
case FaceType:
faces_or_wires.push_back(((CFace*)object)->Face());
if(wxGetApp().m_extrude_removes_sketches)sketches_or_faces_to_delete.push_back(object);
break;
default:
break;
}
}
wxGetApp().DeleteUndoably(sketches_or_faces_to_delete);
}
示例9: Run
void TransformObjectsTool::Run(bool redo){
std::list<HeeksObj*>::iterator It;
for(It = m_list.begin(); It != m_list.end(); It++){
HeeksObj* object = *It;
object->ModifyByMatrix(modify_matrix);
}
wxGetApp().WereModified(m_list);
}
示例10: RollBack
void TransformObjectsTool::RollBack(){
std::list<HeeksObj*>::const_iterator It;
for(It = m_list.begin(); It != m_list.end(); It++){
HeeksObj* object = *It;
object->ModifyByMatrix(revert_matrix);
}
wxGetApp().WereModified(m_list);
}
示例11: SetColor
void CSketch::SetColor(const HeeksColor &col)
{
std::list<HeeksObj*>::iterator It;
for(It=m_objects.begin(); It!=m_objects.end() ;It++)
{
HeeksObj* object = *It;
object->SetColor(col);
}
}
示例12: RemoveUncopyable
//static
void TransformTools::RemoveUncopyable()
{
std::list<HeeksObj*> uncopyable_objects;
for(std::list<HeeksObj*>::const_iterator It = wxGetApp().m_marked_list->list().begin(); It != wxGetApp().m_marked_list->list().end(); It++)
{
HeeksObj* object = *It;
if(!object->CanBeCopied())uncopyable_objects.push_back(object);
}
if(uncopyable_objects.size() > 0)wxGetApp().m_marked_list->Remove(uncopyable_objects, true);
}
示例13: OnGripperMoved
void GripperSelTransform::OnGripperMoved( double* from, const double* to ){
if ( m_data.m_type == GripperTypeStretch)
{
bool stretch_done = false;
double shift[3];
if(m_data.m_move_relative){
shift[0] = to[0] - from[0];
shift[1] = to[1] - from[1];
shift[2] = to[2] - from[2];
}
else{
shift[0] = to[0] - m_initial_grip_pos[0];
shift[1] = to[1] - m_initial_grip_pos[1];
shift[2] = to[2] - m_initial_grip_pos[2];
}
{
std::list<HeeksObj *>::iterator It;
for ( It = m_items_marked_at_grab.begin(); It != m_items_marked_at_grab.end(); It++ )
{
HeeksObj* object = *It;
if(object)
{
double p[3] = {m_data.m_x, m_data.m_y, m_data.m_z};
stretch_done = object->StretchTemporary(p, shift,m_data.m_data);
}
}
}
if(stretch_done)
{
m_data.m_x += shift[0];
m_data.m_y += shift[1];
m_data.m_z += shift[2];
from[0] += shift[0];
from[1] += shift[1];
from[2] += shift[2];
m_initial_grip_pos[0] += shift[0];
m_initial_grip_pos[1] += shift[1];
m_initial_grip_pos[2] += shift[2];
}
wxGetApp().Repaint(true);
return;
}
double object_m[16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
if(m_items_marked_at_grab.size() > 0)m_items_marked_at_grab.front()->GetScaleAboutMatrix(object_m);
MakeMatrix ( from, to, object_m, wxGetApp().m_drag_matrix );
wxGetApp().Repaint();
}
示例14: glCommands
void CSketchOp::glCommands(bool select, bool marked, bool no_color)
{
CDepthOp::glCommands(select, marked, no_color);
if (select || marked)
{
// allow sketch operations to be selected
HeeksObj* sketch = heeksCAD->GetIDObject(SketchType, m_sketch);
if (sketch)sketch->glCommands(select, marked, no_color);
}
}
示例15: Run
void Run()
{
for(HeeksObj* object = object_for_tools->GetFirstChild(); object; object = object_for_tools->GetNextChild())
{
if(COperations::IsAnOperation(object->GetType()))
{
((COp*)object)->m_active = true;
}
}
heeksCAD->Changed();
}