Commit 75ef1b67 authored by Erik Andresen's avatar Erik Andresen
Browse files

bug related to the disabling of hlines fixed

parent 8ff0f0d1
......@@ -24,7 +24,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>21</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuDatei">
......@@ -410,7 +410,7 @@
<bool>true</bool>
</property>
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
......@@ -423,7 +423,7 @@
<string>Landmark</string>
</property>
<property name="visible">
<bool>true</bool>
<bool>false</bool>
</property>
</action>
<action name="actionLandmarkWidget">
......@@ -431,7 +431,7 @@
<bool>true</bool>
</property>
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
......@@ -444,7 +444,7 @@
<string>LandmarkSpecs</string>
</property>
<property name="visible">
<bool>true</bool>
<bool>false</bool>
</property>
</action>
<action name="actionanglesnap">
......@@ -566,7 +566,7 @@
</action>
<action name="actionSpeichern_cogmap">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="Ressource.qrc">
......@@ -582,7 +582,7 @@
<string>Ctrl+S</string>
</property>
<property name="visible">
<bool>true</bool>
<bool>false</bool>
</property>
</action>
<action name="action_ffnen_cogmap">
......@@ -596,6 +596,9 @@
<property name="toolTip">
<string>Load Cognitive Map</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action name="actionCopy">
<property name="text">
......
......@@ -173,6 +173,9 @@ p, li { white-space: pre-wrap; }
<height>31</height>
</rect>
</property>
<property name="maximum">
<number>100000000</number>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
......
......@@ -272,7 +272,7 @@ void jpsGraphicsView::mousePressEvent(QMouseEvent *mouseEvent)
emit DefConnection1Completed();
}
//LineEdit
else if (_currentTrackedPoint!=nullptr && line_tracked==1)
else if (_currentTrackedPoint!=nullptr && line_tracked==1 && _statCopy==0)
{
EditLine(_currentTrackedPoint);
_currentTrackedPoint=nullptr;
......@@ -920,6 +920,7 @@ void jpsGraphicsView::disable_drawing()
statExit=false;
statLandmark=false;
_statLineEdit=false;
_statHLine=false;
_statCopy=0;
// if drawing was canceled by pushing ESC
if (current_line!=nullptr)
......@@ -939,7 +940,7 @@ void jpsGraphicsView::disable_drawing()
jpsLineItem* jpsGraphicsView::addLineItem(const qreal &x1,const qreal &y1,const qreal &x2,const qreal &y2,const QString &type)
{
QPen pen = QPen(Qt::black,0);
QPen pen = QPen(Qt::black,2);
pen.setCosmetic(true);
current_line=Scene->addLine(x1,y1,x2,y2,pen);
......
......@@ -958,12 +958,12 @@ void jpsDatamanager::WriteLandmarks(jpsRegion* cRegion, QXmlStreamWriter *stream
if (fuzzy)
{
px = MakeItFuzzy(px,a/2.0);
py = MakeItFuzzy(py,b/2.0);
a = MakeItFuzzy(a,a/2.0);
px = MakeItFuzzy(px,a/5.0);
py = MakeItFuzzy(py,b/5.0);
a = MakeItFuzzy(a,a/3.0);
if (a<0.5)
a=0.5;
b = MakeItFuzzy(b,b/2.0);
b = MakeItFuzzy(b,b/3.0);
if (b<0.5)
b=0.5;
}
......@@ -1001,14 +1001,20 @@ void jpsDatamanager::CutOutLandmarks()
{
using myClock = std::chrono::high_resolution_clock;
int numberMainTargets = GetNumberOfMainTargets();
int statcutMainTarget= numberMainTargets;
int number;
int n=0;
for (jpsLandmark* landmark:_landmarksAfterLoose)
{
// at least one main target will be kept
if (landmark->GetType()=="main" || landmark->GetType()=="Main Target")
{
continue;
if (numberMainTargets==1)
continue;
else if (statcutMainTarget==1)
continue;
}
myClock::duration d = myClock::now().time_since_epoch();
......@@ -1017,12 +1023,14 @@ void jpsDatamanager::CutOutLandmarks()
std::default_random_engine generator(seed);
std::discrete_distribution<int> distribution({ 40,60 });
std::discrete_distribution<int> distribution({ 30,70 });
number = distribution(generator);
if (!number)
{
if (landmark->GetType()=="main" || landmark->GetType()=="Main Target")
statcutMainTarget--;
_landmarksAfterLoose.removeOne(landmark);
BridgeLostLandmark(landmark);
}
......@@ -1162,6 +1170,19 @@ qreal jpsDatamanager::MakeItFuzzy(const qreal& mean, const qreal &std)
return number;
}
int jpsDatamanager::GetNumberOfMainTargets() const
{
int counter=0;
for (jpsLandmark* landmark:_landmarks)
{
if (landmark->GetType()=="main" || landmark->GetType()=="Main Target")
{
counter++;
}
}
return counter;
}
void jpsDatamanager::remove_all()
{
remove_all_crossings();
......
......@@ -154,6 +154,7 @@ public:
void WriteConnections(jpsRegion *cRegion, QXmlStreamWriter *stream);
void CreateAndSaveASimilarCogMap(const int &id);
qreal MakeItFuzzy(const qreal &mean, const qreal& std);
int GetNumberOfMainTargets() const;
// Read DXF
bool readDXF(std::string filename);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment