本文整理汇总了C++中HeeksConfig::Read方法的典型用法代码示例。如果您正苦于以下问题:C++ HeeksConfig::Read方法的具体用法?C++ HeeksConfig::Read怎么用?C++ HeeksConfig::Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeeksConfig
的用法示例。
在下文中一共展示了HeeksConfig::Read方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PickCreateExtrusion
void PickCreateExtrusion()
{
if(wxGetApp().m_marked_list->size() == 0)
{
wxGetApp().PickObjects(_("pick sketches, faces or circles"), MARKING_FILTER_CIRCLE | MARKING_FILTER_SKETCH | MARKING_FILTER_FACE);
}
double height;
double taper_angle;
{
HeeksConfig config;
config.Read(_T("ExtrusionHeight"), &height, 10.0);
config.Read(_T("ExtrusionTaperAngle"), &taper_angle, 0.0);
}
if(InputExtrusionHeight(height, &(wxGetApp().m_extrude_to_solid), &taper_angle))
{
{
HeeksConfig config;
config.Write(_T("ExtrusionHeight"), height);
config.Write(_T("ExtrusionTaperAngle"), taper_angle);
config.Write(_T("ExtrudeToSolid"), wxGetApp().m_extrude_to_solid);
}
if(wxGetApp().m_marked_list->size() > 0)
{
wxGetApp().StartHistory();
CreateExtrusionOrRevolution(wxGetApp().m_marked_list->list(),height, wxGetApp().m_extrude_to_solid, false, taper_angle);
wxGetApp().EndHistory();
}
}
}
示例2: ReadDefaultValues
void CTag::ReadDefaultValues()
{
HeeksConfig config;
config.Read(_T("Width"), &m_width);
config.Read(_T("Angle"), &m_angle);
config.Read(_T("Height"), &m_height);
}
示例3: set_initial_values
void COrientationModifierParams::set_initial_values()
{
HeeksConfig config;
config.Read(_T("OrientationModifier_m_spacing"), (int *) &m_spacing, int(eNormalSpacing));
config.Read(_T("OrientationModifier_number_of_rotations"), (int *) &m_number_of_rotations, 0);
config.Read(_T("OrientationModifier_sketch_rotates_text"), &m_sketch_rotates_text, false);
config.Read(_T("OrientationModifier_justification"), (int *) &m_justification, int(eLeftJustified));
}
示例4: CDxfRead
HeeksDxfRead::HeeksDxfRead(const wxChar* filepath, bool undoable) : CDxfRead(Ttc(filepath)), m_undoable(undoable)
{
HeeksConfig config;
config.Read(_T("ImportDxfAsSketches"), &m_make_as_sketch);
config.Read(_T("IgnoreDxfReadErrors"), &m_ignore_errors);
config.Read(_T("DxfReadPoints"), &m_read_points);
config.Read(_T("LayerNameSuffixesToDiscard"), m_layer_name_suffixes_to_discard);
m_current_block = NULL;
extract(gp_Trsf(), m_ucs_matrix);
}
示例5: Run
// Tool's virtual functions
void Run(){
double offset_value = 2.0;
HeeksConfig config;
config.Read(_T("OffsetShapeValue"), &offset_value);
if(wxGetApp().InputLength(_("Enter Offset Value, + for making bigger, - for making smaller"), _("Offset value"), offset_value))
{
try
{
TopoDS_Shape new_shape = BRepOffsetAPI_MakeOffsetShape(shape_for_tools->Shape(), offset_value, wxGetApp().m_geom_tol);
#ifdef TESTNEWSHAPE
//This will end up throwing 90% of the exceptions caused by a bad offset
BRepTools::Clean(new_shape);
BRepMesh::Mesh(new_shape, 1.0);
#endif
HeeksObj* new_object = CShape::MakeObject(new_shape, _("Result of 'Offset Shape'"), SOLID_TYPE_UNKNOWN, shape_for_tools->m_color, shape_for_tools->GetOpacity());
shape_for_tools->HEEKSOBJ_OWNER->Add(new_object, NULL);
shape_for_tools->HEEKSOBJ_OWNER->Remove(shape_for_tools);
config.Write(_T("OffsetShapeValue"), offset_value);
}
catch (Standard_Failure) {
Handle_Standard_Failure e = Standard_Failure::Caught();
wxMessageBox(wxString(_("Error making offset")) + _T(": ") + Ctt(e->GetMessageString()));
}
}
}
示例6: PickCreateRevolution
void PickCreateRevolution()
{
if(wxGetApp().m_marked_list->size() == 0)
{
wxGetApp().PickObjects(_("pick sketches, faces or circles"), MARKING_FILTER_CIRCLE | MARKING_FILTER_SKETCH | MARKING_FILTER_FACE);
}
double angle;
{
HeeksConfig config;
config.Read(_T("RevolutionAngle"), &angle, 360.0);
}
if(InputRevolutionAngle(angle, &wxGetApp().m_extrude_to_solid))
{
{
HeeksConfig config;
config.Write(_T("RevolutionAngle"), angle);
}
if(wxGetApp().m_marked_list->size() > 0)
{
CreateExtrusionOrRevolution(wxGetApp().m_marked_list->list(), angle, wxGetApp().m_extrude_to_solid, true, 0.0, true);
}
}
}
示例7: Run
void Run()
{
wxString message(_("Use negative for smaller and Positive for larger)"));
wxString prompt(_("Enter the distance"));
wxString caption(_("Distance"));
double distance;
HeeksConfig config;
config.Read(_T("CopyParallelDistance"), &distance, 1.0);
if(wxGetApp().InputDouble(wxString(_("Use negative for smaller and Positive for larger)") ), _("Enter the distance"), distance))
{
config.Write(_T("CopyParallelDistance"), distance);
HeeksObj *parallel_sketch = sketch_for_tools->Parallel( double(distance) );
if (parallel_sketch != NULL)
{
wxGetApp().StartHistory();
wxGetApp().AddUndoably(parallel_sketch, NULL, NULL);
wxGetApp().EndHistory();
}
else
{
wxMessageBox(wxString(_("Error making offset")));
}
}
}
示例8: Run
void Run(){
double rad = 2.0;
HeeksConfig config;
config.Read(_T("EdgeBlendRadius"), &rad);
if(wxGetApp().InputLength(_("Enter Blend Radius"), _("Radius"), rad))
{
edge_for_tools->Blend(rad,false);
config.Write(_T("EdgeBlendRadius"), rad);
}
}
示例9: ReadDefaultValues
void CPocket::ReadDefaultValues()
{
CSketchOp::ReadDefaultValues();
HeeksConfig config;
config.Read(_T("StepOver"), &m_step_over, 1.0);
int int_mode = m_cut_mode;
config.Read(_T("CutMode"), &int_mode, CPocket::eConventional);
m_cut_mode = (CPocket::eCutMode)int_mode;
config.Read(_T("MaterialAllowance"), &m_material_allowance, 0.2);
config.Read(_T("FromCenter"), &m_starting_place, 1);
config.Read(_T("KeepToolDown"), &m_keep_tool_down_if_poss, true);
config.Read(_T("UseZigZag"), &m_use_zig_zag, false);
config.Read(_T("ZigAngle"), &m_zig_angle);
config.Read(_T("ZigUnidirectional"), &m_zig_unidirectional, false);
int int_for_entry_move = CPocket::ePlunge;
config.Read(_T("DecentStrategy"), &int_for_entry_move);
m_entry_move = (CPocket::eEntryStyle) int_for_entry_move;
}
示例10: ReadFromConfig
void HRuler::ReadFromConfig(HeeksConfig& config)
{
double m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34;
config.Read(_T("RulerTrsf11"), &m11, 1.0);
config.Read(_T("RulerTrsf12"), &m12, 0.0);
config.Read(_T("RulerTrsf13"), &m13, 0.0);
config.Read(_T("RulerTrsf14"), &m14, 0.0);
config.Read(_T("RulerTrsf21"), &m21, 0.0);
config.Read(_T("RulerTrsf22"), &m22, 1.0);
config.Read(_T("RulerTrsf23"), &m23, 0.0);
config.Read(_T("RulerTrsf24"), &m24, 0.0);
config.Read(_T("RulerTrsf31"), &m31, 0.0);
config.Read(_T("RulerTrsf32"), &m32, 0.0);
config.Read(_T("RulerTrsf33"), &m33, 1.0);
config.Read(_T("RulerTrsf34"), &m34, 0.0);
m_trsf.SetValues(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, 0.0001, 0.00000001);
config.Read(_T("RulerUseViewUnits"), &m_use_view_units);
config.Read(_T("RulerUnits"), &m_units);
config.Read(_T("RulerWidth"), &m_width);
config.Read(_T("RulerLength"), &m_length);
config.Read(_T("RulerEmptyLength"), &m_empty_length);
}
示例11: SaveSettings
void SaveSettings()
{
HeeksConfig config;
config.Write(_T("SketchToolOptions_reorder"), m_reorder);
config.Write(_T("SketchToolOptions_max_gap"), m_max_gap);
config.Write(_T("SketchToolOptions_fix_small"), m_fix_small);
config.Write(_T("SketchToolOptions_fix_small_precision"), m_fix_small_precision);
config.Write(_T("SketchToolOptions_fix_self_intersection"), m_fix_self_intersection);
config.Write(_T("SketchToolOptions_fix_lacking"), m_fix_lacking);
config.Write(_T("SketchToolOptions_fix_degenerated"), m_fix_degenerated);
config.Write(_T("SketchToolOptions_modify_topology"), m_modify_topology);
config.Write(_T("SketchToolOptions_modify_geometry"), m_modify_geometry);
config.Write(_T("SketchToolOptions_closed_wire"), m_closed_wire);
config.Write(_T("SketchToolOptions_preference_pcurve"), m_preference_pcurve);
config.Write(_T("SketchToolOptions_fix_gaps_by_ranges"), m_fix_gaps_by_ranges);
config.Write(_T("SketchToolOptions_max_deviation"), m_max_deviation);
config.Write(_T("SketchToolOptions_cleanup_tolerance"), m_cleanup_tolerance);
config.Write(_T("SketchToolOptions_degree_min"), m_degree_min);
config.Write(_T("SketchToolOptions_degree_max"), m_degree_max);
config.Write(_T("SketchToolOptions_continuity"), m_continuity);
config.Write(_T("SketchToolOptions_sort_points"), m_sort_points);
config.Read(_T("SketchToolOptions_force_closed_shape"), m_force_closed_shape);
}
示例12: Run
void SaveSolids::Run(){
std::list<HeeksObj*> 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;
switch(object->GetType())
{
case SolidType:
case StlSolidType:
case FaceType:
{
objects.push_back(object);
}
break;
}
}
if(objects.size() > 0)
{
wxString filepath(_T(""));
{
// get last used filepath
HeeksConfig config;
config.Read(_T("SolidExportFilepath"), &filepath, _T(""));
}
wxFileDialog fd(wxGetApp().m_frame, _("Save solid file"), wxEmptyString, filepath, wxString(_("Solid Files")) + _T(" |*.igs;*.iges;*.stp;*.step;*.stl;*.cpp;*.py;*.obj|") + _("IGES files") + _T(" (*.igs *.iges)|*.igs;*.iges|") + _("STEP files") + _T(" (*.stp *.step)|*.stp;*.step|") + _("STL files") + _T(" (*.stl)|*.stl|") + _("CPP files") + _T(" (*.cpp)|*.cpp|") + _("OpenCAMLib python files") + _T(" (*.py)|*.py|") + _("Wavefront .obj files") + _T(" (*.obj)|*.obj"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
fd.SetFilterIndex(0);
if (fd.ShowModal() == wxID_CANCEL)return;
filepath = fd.GetPath();
wxString wf(filepath);
wf.LowerCase();
if(wf.EndsWith(_T(".stl")))
{
wxGetApp().SaveSTLFile(objects, filepath, -1.0, NULL, wxGetApp().m_stl_save_as_binary);
}
else if(wf.EndsWith(_T(".cpp")))
{
wxGetApp().SaveCPPFile(objects, filepath);
}
else if (wf.EndsWith(_T(".py")))
{
wxGetApp().SavePyFile(objects, filepath);
}
else if (wf.EndsWith(_T(".obj")))
{
wxGetApp().SaveOBJFileAscii(objects, filepath);
}
else if (CShape::ExportSolidsFile(objects, filepath))
{
}
else
{
wxMessageBox(_("Invalid solid file type chosen"));
return;
}
{
// save last used filepath
HeeksConfig config;
config.Write(_T("SolidExportFilepath"), filepath);
}
}
}
示例13: LoadSetttings
void LoadSetttings()
{
HeeksConfig config;
config.Read(_T("SketchToolOptions_reorder"), &m_reorder, true);
config.Read(_T("SketchToolOptions_max_gap"), &m_max_gap, 0.001);
config.Read(_T("SketchToolOptions_fix_small"), &m_fix_small, true);
config.Read(_T("SketchToolOptions_fix_small_precision"), &m_fix_small_precision, 0.0254);
config.Read(_T("SketchToolOptions_fix_self_intersection"), &m_fix_self_intersection, true);
config.Read(_T("SketchToolOptions_fix_lacking"), &m_fix_lacking, true);
config.Read(_T("SketchToolOptions_fix_degenerated"), &m_fix_degenerated, true);
config.Read(_T("SketchToolOptions_modify_topology"), &m_modify_topology, true);
config.Read(_T("SketchToolOptions_modify_geometry"), &m_modify_geometry, true);
config.Read(_T("SketchToolOptions_closed_wire"), &m_closed_wire, true);
config.Read(_T("SketchToolOptions_preference_pcurve"), &m_preference_pcurve, true);
config.Read(_T("SketchToolOptions_fix_gaps_by_ranges"), &m_fix_gaps_by_ranges, true);
config.Read(_T("SketchToolOptions_max_deviation"), &m_max_deviation, 0.001);
config.Read(_T("SketchToolOptions_cleanup_tolerance"), &m_cleanup_tolerance, 0.000001);
config.Read(_T("SketchToolOptions_degree_min"), &m_degree_min, 3);
config.Read(_T("SketchToolOptions_degree_max"), &m_degree_max, 8);
config.Read(_T("SketchToolOptions_continuity"), &m_continuity, 4);
config.Read(_T("SketchToolOptions_sort_points"), &m_sort_points, false);
config.Read(_T("SketchToolOptions_force_closed_shape"), &m_force_closed_shape, false);
}
示例14: Rotate
//static
void TransformTools::Rotate(bool copy)
{
//rotation axis - Z axis by default
gp_Dir axis_Dir = gp_Dir(0,0,1);
gp_Pnt line_Pos = gp_Pnt(0,0,0);
// pick items
if(wxGetApp().m_marked_list->size() == 0){
wxGetApp().PickObjects(_("Pick objects to rotate"));
}
if(wxGetApp().m_marked_list->size() == 0)return;
// get number of copies
HeeksConfig config;
int ncopies;
config.Read(_T("RotateNumCopies"), &ncopies, 1);
if(copy)
{
// check for uncopyable objects
RemoveUncopyable();
if(wxGetApp().m_marked_list->size() == 0)return;
}
// clear the selection
std::list<HeeksObj *> selected_items = wxGetApp().m_marked_list->list();
wxGetApp().m_marked_list->Clear(true);
double angle;
config.Read(_T("RotateAngle"), &angle, 90.0);
// enter angle, plane and position
double axis[3];
double pos[3];
config.Read(_T("RotateAxisX"), &axis[0], 0.0);
config.Read(_T("RotateAxisY"), &axis[1], 0.0);
config.Read(_T("RotateAxisZ"), &axis[2], 1.0);
config.Read(_T("RotatePosX"), &pos[0], 0.0);
config.Read(_T("RotatePosY"), &pos[1], 0.0);
config.Read(_T("RotatePosZ"), &pos[2], 0.0);
double axial_shift;
config.Read(_T("RotateAxialShift"), &axial_shift, 0.0);
if(!wxGetApp().InputAngleWithPlane(angle, axis, pos, copy ? &ncopies : NULL, &axial_shift))return;
if(copy)
{
if(ncopies < 1)return;
config.Write(_T("RotateNumCopies"), ncopies);
}
config.Write(_T("RotateAngle"), angle);
config.Write(_T("RotateAxialShift"), axial_shift);
config.Write(_T("RotateAxisX"), axis[0]);
config.Write(_T("RotateAxisY"), axis[1]);
config.Write(_T("RotateAxisZ"), axis[2]);
config.Write(_T("RotatePosX"), pos[0]);
config.Write(_T("RotatePosY"), pos[1]);
config.Write(_T("RotatePosZ"), pos[2]);
axis_Dir = gp_Dir(axis[0], axis[1], axis[2]);
line_Pos = gp_Pnt(pos[0], pos[1], pos[2]);
// transform the objects
wxGetApp().CreateUndoPoint();
if(copy)
{
for(int i = 0; i<ncopies; i++)
{
gp_Trsf mat;
mat.SetRotation(gp_Ax1(line_Pos, axis_Dir), angle * M_PI/180 * (i+1));
gp_Trsf tmat;
tmat.SetTranslation(gp_Vec(axis_Dir.XYZ() * (axial_shift * ((double)(i+1)) / ncopies)));
mat = tmat * mat;
double m[16];
extract(mat, m);
for(std::list<HeeksObj*>::iterator It = selected_items.begin(); It != selected_items.end(); It++)
{
HeeksObj* object = *It;
HeeksObj* new_object = object->MakeACopy();
new_object->ModifyByMatrix(m); // Rotate the duplicate object.
#ifdef MULTIPLE_OWNERS
object->HEEKSOBJ_OWNER->Add(new_object, NULL); // And add it to this object's owner
#else
object->m_owner->Add(new_object, NULL); // And add it to this object's owner
#endif
}
}
wxGetApp().m_marked_list->Clear(true);
}
else
{
gp_Trsf mat;
mat.SetRotation(gp_Ax1(line_Pos, axis_Dir), angle * M_PI/180);
gp_Trsf tmat;
tmat.SetTranslation(gp_Vec(axis_Dir.XYZ() * axial_shift));
mat = tmat * mat;
double m[16];
extract(mat, m);
wxGetApp().Transform(selected_items, m);
}
wxGetApp().Changed();
//.........这里部分代码省略.........
示例15: Scale
void TransformTools::Scale(bool copy)
{
// pick items
if(wxGetApp().m_marked_list->size() == 0){
wxGetApp().PickObjects(_("Pick objects to scale"));
}
if(wxGetApp().m_marked_list->size() == 0)return;
// get number of copies
int ncopies;
HeeksConfig config;
config.Read(_T("ScaleNumCopies"), &ncopies, 1);
if(copy)
{
// check for uncopyable objects
RemoveUncopyable();
if(wxGetApp().m_marked_list->size() == 0)return;
// input "number of copies"
if(!wxGetApp().InputInt(_("Enter number of copies"), _("number of copies"), ncopies))return;
if(ncopies < 1)return;
config.Write(_T("ScaleNumCopies"), ncopies);
}
// clear the selection
std::list<HeeksObj *> selected_items = wxGetApp().m_marked_list->list();
wxGetApp().m_marked_list->Clear(true);
// pick "centre" position
if(!wxGetApp().PickPosition(_("Click centre position to scale about"), centre))return;
// enter scale factor
double scale;
config.Read(_T("ScaleFactor"), &scale, 2.0);
if(!wxGetApp().InputDouble(_("Enter scale factor"), _("scale factor"), scale))return;
config.Write(_T("ScaleFactor"), scale);
// transform the objects
wxGetApp().CreateUndoPoint();
if(copy)
{
for(int i = 0; i<ncopies; i++)
{
gp_Trsf mat;
mat.SetScale(make_point(centre), scale * (i+1));
double m[16];
extract(mat, m);
for(std::list<HeeksObj*>::iterator It = selected_items.begin(); It != selected_items.end(); It++)
{
HeeksObj* object = *It;
HeeksObj* new_object = object->MakeACopy();
#ifdef MULTIPLE_OWNERS
object->HEEKSOBJ_OWNER->Add(new_object, NULL);
#else
object->m_owner->Add(new_object, NULL);
#endif
new_object->ModifyByMatrix(m);
}
}
wxGetApp().m_marked_list->Clear(true);
}
else
{
gp_Trsf mat;
mat.SetScale(make_point(centre), scale);
double m[16];
extract(mat, m);
wxGetApp().Transform(selected_items, m);
}
wxGetApp().Changed();
}