~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/App/DocumentObject.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2010-01-11 08:48:33 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100111084833-4g9vgdqbkw8u34zb
Tags: 0.9.2646.5-1
* New upstream version (closes: #561696).
* Added swig to Build-Depends (closes: #563523, #563772).
* Removed python-opencv from Build-Depends and Recommends (closes: #560768).

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    }
64
64
}
65
65
 
 
66
namespace App {
 
67
class ObjectExecution
 
68
{
 
69
public:
 
70
    ObjectExecution(DocumentObject* o) : obj(o)
 
71
    { obj->StatusBits.set(3); }
 
72
    ~ObjectExecution()
 
73
    { obj->StatusBits.reset(3); }
 
74
private:
 
75
    DocumentObject* obj;
 
76
};
 
77
}
 
78
 
 
79
App::DocumentObjectExecReturn *DocumentObject::recompute(void)
 
80
{
 
81
    // set/unset the execution bit
 
82
    ObjectExecution exe(this);
 
83
    return this->execute();
 
84
}
 
85
 
66
86
DocumentObjectExecReturn *DocumentObject::execute(void)
67
87
{
68
88
    return DocumentObject::StdReturn;
70
90
 
71
91
short DocumentObject::mustExecute(void) const
72
92
{
73
 
    return 0;
 
93
    return (isTouched() ? 1 : 0);
74
94
}
75
95
 
76
96
const char* DocumentObject::getStatusString(void) const
94
114
    //assert(pcNameInDocument);
95
115
    if (!pcNameInDocument) return 0;
96
116
    return pcNameInDocument->c_str();
97
 
 /* 
98
 
    std::map<std::string,DocumentObject*>::const_iterator It = _pDoc->ObjectMap.begin();
99
 
    while(It != _pDoc->ObjectMap.end() && It->second!= this) ++It;
100
 
    assert(It != _pDoc->ObjectMap.end());
101
 
    return It->first.c_str();
102
 
   */ 
103
117
}
104
118
 
105
119
void DocumentObject::onLoseLinkToObject(DocumentObject*)
145
159
 
146
160
void DocumentObject::touch(void)
147
161
{
148
 
    //touchTime.setToActual();
149
162
    StatusBits.set(0);
150
163
}
151
164
 
154
167
    writer.ObjectName = this->getNameInDocument();
155
168
    App::PropertyContainer::Save(writer);
156
169
}
157
 
 
158
 
/*
159
 
void DocumentObject::TouchView(void)
160
 
{
161
 
    touchViewTime.setToActual();
162
 
}
163
 
*/