コード例 #1
0
void DrawViewSection::onChanged(const App::Property* prop)
{
    if (!isRestoring()) {
        //Base::Console().Message("TRACE - DVS::onChanged(%s) - %s\n",prop->getName(),Label.getValue());
        if (prop == &SectionSymbol) {
            std::string lblText = "Section " +
                                  std::string(SectionSymbol.getValue()) +
                                  " - " +
                                  std::string(SectionSymbol.getValue());
            Label.setValue(lblText);
        }
        if (prop == &SectionOrigin) {
            App::DocumentObject* base = BaseView.getValue();
            if (base != nullptr) {
                base->touch();
            }
        }
    }
    DrawView::onChanged(prop);
}
コード例 #2
0
ファイル: DrawViewSection.cpp プロジェクト: itain/FreeCAD
void DrawViewSection::onChanged(const App::Property* prop)
{
    if (!isRestoring()) {
        //Base::Console().Message("TRACE - DVS::onChanged(%s) - %s\n",prop->getName(),Label.getValue());
        if (prop == &SectionSymbol) {
            std::string lblText = "Section " +
                                  std::string(SectionSymbol.getValue()) +
                                  " - " +
                                  std::string(SectionSymbol.getValue());
            Label.setValue(lblText);
        }
        if (prop == &SectionOrigin) {
            App::DocumentObject* base = BaseView.getValue();
            if (base != nullptr) {
                base->touch();
            }
        }
    }
    if (prop == &FileHatchPattern    ||
        prop == &NameGeomPattern ) {
      if ((!FileHatchPattern.isEmpty())  &&
          (!NameGeomPattern.isEmpty())) {
              std::vector<PATLineSpec> specs = 
                               DrawGeomHatch::getDecodedSpecsFromFile(FileHatchPattern.getValue(),NameGeomPattern.getValue());
              m_lineSets.clear();
              for (auto& hl: specs) {
                  //hl.dump("hl from section");
                  LineSet ls;
                  ls.setPATLineSpec(hl);
                  m_lineSets.push_back(ls);
              }
                  
      }
    }

    DrawView::onChanged(prop);
}