void HRuler::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { gp_Pnt point[4]; GetFourCorners(point); for(int i = 0; i<4; i++)point[i].Transform(m_trsf); list->push_back(GripData(GripperTypeRotateObject,point[0].X(),point[0].Y(),point[0].Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,point[2].X(),point[2].Y(),point[2].Z(),NULL)); }
void CMeshVertex::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { // vertex Point vt = vertex(); list->push_back(GripData(GripperTypeStretch,vt.x,vt.y,vt.z,NULL, false, 1)); for(std::set<CMeshEdge*>::iterator It = m_edges.begin(); It != m_edges.end(); It++) { CMeshEdge* edge = *It; CMeshPosition& p = edge->GetControlPointNearVertex(this); vt = p.vertex(); list->push_back(GripData(GripperTypeStretch,vt.x,vt.y,vt.z,NULL, true, 0)); } }
void CCylinder::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { gp_Pnt o = m_pos.Location(); gp_Pnt px(o.XYZ() + m_pos.XDirection().XYZ() * m_radius); gp_Dir z_dir = m_pos.XDirection() ^ m_pos.YDirection(); gp_Pnt pyz(o.XYZ() + m_pos.YDirection().XYZ() * m_radius + z_dir.XYZ() * m_height); gp_Pnt pmxz(o.XYZ() + m_pos.XDirection().XYZ() * (-m_radius) + z_dir.XYZ() * m_height); gp_Pnt pz(o.XYZ() + z_dir.XYZ() * m_height); list->push_back(GripData(GripperTypeTranslate,o.X(),o.Y(),o.Z(),NULL)); list->push_back(GripData(GripperTypeObjectScaleXY,px.X(),px.Y(),px.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,pyz.X(),pyz.Y(),pyz.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,pmxz.X(),pmxz.Y(),pmxz.Z(),NULL)); list->push_back(GripData(GripperTypeObjectScaleZ,pz.X(),pz.Y(),pz.Z(),NULL)); }
void HGear::GetGripperPositions(std::list<GripData> *list, bool just_for_endof){ gp_Pnt o = m_pos.Location(); double acting_radius = (double)(m_module * m_num_teeth)/2; gp_Pnt px(o.XYZ() + m_pos.XDirection().XYZ() * acting_radius); gp_Pnt py(o.XYZ() + m_pos.YDirection().XYZ() * acting_radius); gp_Dir z_dir = m_pos.XDirection() ^ m_pos.YDirection(); gp_Pnt pz(o.XYZ() + z_dir.XYZ() * acting_radius); gp_Pnt pxyz(o.XYZ() + m_pos.XDirection().XYZ() * acting_radius + m_pos.YDirection().XYZ() * acting_radius + z_dir.XYZ() * acting_radius); list->push_back(GripData(GripperTypeTranslate,o.X(),o.Y(),o.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,px.X(),px.Y(),px.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,py.X(),py.Y(),py.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,pz.X(),pz.Y(),pz.Z(),NULL)); list->push_back(GripData(GripperTypeScale,pxyz.X(),pxyz.Y(),pxyz.Z(),NULL)); }
void HeeksObj::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { //#ifdef HEEKSCAD CBox box; GetBox(box); if(!box.m_valid)return; //TODO: This is a tab bit of a strange thing to do. Especially for planar objects like faces //ones that are on a plane like y-z or x-z will have all gripper merged togeather. list->push_back(GripData(GripperTypeTranslate,box.m_x[0],box.m_x[1],box.m_x[2],NULL)); list->push_back(GripData(GripperTypeRotateObject,box.m_x[3],box.m_x[1],box.m_x[2],NULL)); list->push_back(GripData(GripperTypeRotateObject,box.m_x[0],box.m_x[4],box.m_x[2],NULL)); list->push_back(GripData(GripperTypeScale,box.m_x[3],box.m_x[4],box.m_x[2],NULL)); //#endif }
void HPoint::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { if(just_for_endof) { list->push_back(GripData((EnumGripperType)0,m_p.X(),m_p.Y(),m_p.Z(),NULL)); } }
void CEdge::GetGripperPositions(std::list<GripData> *list, bool just_for_endof){ if(just_for_endof) { list->push_back(GripData(GripperTypeTranslate,m_start_x,m_start_y,m_start_z,NULL)); list->push_back(GripData(GripperTypeTranslate,m_end_x,m_end_y,m_end_z,NULL)); } else { // add a gripper in the middle, just to show the edge is selected if(!m_midpoint_calculated) { BRepAdaptor_Curve curve(m_topods_edge); double us = curve.FirstParameter(); double ue = curve.LastParameter(); double umiddle = (us+ue)/2; Evaluate(umiddle, m_midpoint, NULL); } list->push_back(GripData(GripperTypeTranslate,m_midpoint[0],m_midpoint[1],m_midpoint[2],NULL)); } }
void HDimension::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { wxString text = MakeText(); float width, height; if(!wxGetApp().get_text_size(text, &width, &height))return; gp_Pnt point[4]; point[0] = gp_Pnt(0, 0, 0); point[1] = gp_Pnt(width, 0, 0); point[2] = gp_Pnt(0, -height, 0); point[3] = gp_Pnt(width, -height, 0); for(int i = 0; i<4; i++)point[i].Transform(m_trsf); list->push_back(GripData(GripperTypeTranslate,point[0].X(),point[0].Y(),point[0].Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,point[1].X(),point[1].Y(),point[1].Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,point[2].X(),point[2].Y(),point[2].Z(),NULL)); list->push_back(GripData(GripperTypeScale,point[3].X(),point[3].Y(),point[3].Z(),NULL)); EndedObject::GetGripperPositions(list,just_for_endof); list->push_back(GripData(GripperTypeStretch,m_p2->m_p.X(),m_p2->m_p.Y(),m_p2->m_p.Z(),&m_p2)); }
void HImage::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { for(int j = 0; j<4; j++){ list->push_back(GripData(GripperTypeStretch,m_x[j][0],m_x[j][1],m_x[j][2],NULL)); } }
} str_for_GetHelpText.Append(wxString(_T("\n")) + _("Right button for object menu")); str_for_GetHelpText.Append(wxString(_T("\n")) + _("See options window to hide this help")); str_for_GetHelpText.Append(wxString(_T("\n")) + _T("( ") + _("view options") + _T("->") + _("screen text") + _T(" )")); if(m_doing_a_main_loop) { str_for_GetHelpText.Append(wxString(_T("\n")) + _("Press Esc key to cancel")); if(wxGetApp().m_marked_list->size() > 0)str_for_GetHelpText.Append(wxString(_T("\n")) + _("Press Return key to accept selection")); } return str_for_GetHelpText; } static GripperSelTransform drag_object_gripper(GripData(GripperTypeTranslate, 0, 0, 0), NULL); void CSelectMode::OnMouse( wxMouseEvent& event ) { bool event_used = false; if(LeftAndRightPressed(event, event_used)) { if(m_doing_a_main_loop){ wxGetApp().ExitMainLoop(); } } if(event_used)return; if(event.LeftDown()) {
void CCuboid::GetGripperPositions(std::list<GripData> *list, bool just_for_endof) { gp_Pnt o = m_pos.Location(); gp_Pnt px(o.XYZ() + m_pos.XDirection().XYZ() * m_x); gp_Pnt py(o.XYZ() + m_pos.YDirection().XYZ() * m_y); gp_Dir z_dir = m_pos.XDirection() ^ m_pos.YDirection(); gp_Pnt pz(o.XYZ() + z_dir.XYZ() * m_z); gp_Pnt m2(o.XYZ() + m_pos.XDirection().XYZ() * m_x + m_pos.YDirection().XYZ() * m_y/2); gp_Pnt m3(o.XYZ() + m_pos.XDirection().XYZ() * m_x/2 + m_pos.YDirection().XYZ() * m_y); gp_Pnt m8(o.XYZ() + m_pos.YDirection().XYZ() * m_y/2 + z_dir.XYZ() * m_z); gp_Pnt pxy(o.XYZ() + m_pos.XDirection().XYZ() * m_x + m_pos.YDirection().XYZ() * m_y); gp_Pnt pxz(o.XYZ() + m_pos.XDirection().XYZ() * m_x + z_dir.XYZ() * m_z); gp_Pnt pyz(o.XYZ() + m_pos.YDirection().XYZ() * m_y + z_dir.XYZ() * m_z); gp_Pnt pxyz(o.XYZ() + m_pos.XDirection().XYZ() * m_x + m_pos.YDirection().XYZ() * m_y + z_dir.XYZ() * m_z); list->push_back(GripData(GripperTypeTranslate,o.X(),o.Y(),o.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,px.X(),px.Y(),px.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,py.X(),py.Y(),py.Z(),NULL)); list->push_back(GripData(GripperTypeRotateObject,pz.X(),pz.Y(),pz.Z(),NULL)); list->push_back(GripData(GripperTypeScale,pxyz.X(),pxyz.Y(),pxyz.Z(),NULL)); list->push_back(GripData(GripperTypeRotate,pxy.X(),pxy.Y(),pxy.Z(),NULL)); list->push_back(GripData(GripperTypeRotate,pxz.X(),pxz.Y(),pxz.Z(),NULL)); list->push_back(GripData(GripperTypeRotate,pyz.X(),pyz.Y(),pyz.Z(),NULL)); list->push_back(GripData(GripperTypeObjectScaleX,m2.X(),m2.Y(),m2.Z(),NULL)); list->push_back(GripData(GripperTypeObjectScaleY,m3.X(),m3.Y(),m3.Z(),NULL)); list->push_back(GripData(GripperTypeObjectScaleZ,m8.X(),m8.Y(),m8.Z(),NULL)); }
void HVertex::GetGripperPositions(std::list<GripData> *list, bool just_for_endof){ list->push_back(GripData(GripperTypeTranslate,m_point[0],m_point[1],m_point[2],NULL)); }