Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
grapa_alisa
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alisa Jung
grapa_alisa
Commits
1098166a
Commit
1098166a
authored
Nov 22, 2015
by
Alisa Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added some stuff to treeitem
parent
e334b7ab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
1 deletion
+22
-1
primitive.h
helloqube/primitive.h
+0
-1
rigidbodytransformation.cpp
helloqube/rigidbodytransformation.cpp
+1
-0
treeitem.cpp
helloqube/treeitem.cpp
+16
-0
treeitem.h
helloqube/treeitem.h
+5
-0
No files found.
helloqube/primitive.h
View file @
1098166a
...
@@ -23,7 +23,6 @@ public:
...
@@ -23,7 +23,6 @@ public:
protected
:
protected
:
int
ID
;
int
ID
;
QString
name
;
int
tesselation
;
int
tesselation
;
Type
type
;
Type
type
;
};
};
...
...
helloqube/rigidbodytransformation.cpp
View file @
1098166a
...
@@ -8,6 +8,7 @@ RigidBodyTransformation::RigidBodyTransformation(Primitive* child)
...
@@ -8,6 +8,7 @@ RigidBodyTransformation::RigidBodyTransformation(Primitive* child)
// this->child = child;
// this->child = child;
children
.
append
(
child
);
children
.
append
(
child
);
name
=
""
;
// qDebug() << "new rbt " << tx << "," << ty << "," << tz << ", rot " << rotation;
// qDebug() << "new rbt " << tx << "," << ty << "," << tz << ", rot " << rotation;
}
}
...
...
helloqube/treeitem.cpp
View file @
1098166a
...
@@ -46,3 +46,19 @@ TreeItem* TreeItem::getChild(int index){
...
@@ -46,3 +46,19 @@ TreeItem* TreeItem::getChild(int index){
}
}
return
0
;
return
0
;
}
}
int
TreeItem
::
columnCount
(){
return
1
;
}
QVariant
TreeItem
::
data
(
int
column
){
if
(
column
==
0
)
return
QVariant
(
name
);
else
return
QVariant
(
"ERROR column index"
);
}
int
TreeItem
::
childNumber
(){
if
(
parent
){
return
parent
->
getChildren
().
indexOf
(
this
);
}
return
0
;
//for root.
}
helloqube/treeitem.h
View file @
1098166a
...
@@ -14,14 +14,19 @@ public:
...
@@ -14,14 +14,19 @@ public:
QList
<
TreeItem
*>
getChildren
();
QList
<
TreeItem
*>
getChildren
();
TreeItem
*
getChild
(
int
index
);
//return 0 if index too large
TreeItem
*
getChild
(
int
index
);
//return 0 if index too large
int
getChildrenCount
();
int
getChildrenCount
();
int
columnCount
();
QVariant
data
(
int
column
);
//returns QVariant for name string
void
addChild
(
TreeItem
*
item
);
void
addChild
(
TreeItem
*
item
);
bool
removeChild
(
TreeItem
*
item
);
bool
removeChild
(
TreeItem
*
item
);
void
setParent
(
TreeItem
*
parent
);
void
setParent
(
TreeItem
*
parent
);
int
childNumber
();
protected
:
protected
:
TreeItem
*
parent
;
TreeItem
*
parent
;
QList
<
TreeItem
*>
children
;
QList
<
TreeItem
*>
children
;
QString
name
;
};
};
#endif // TREEITEM_H
#endif // TREEITEM_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment