-
Notifications
You must be signed in to change notification settings - Fork 3
disk management 29.7 #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: team_Storage
Are you sure you want to change the base?
Conversation
Storage/DiskManagment.c
Outdated
| { | ||
| //If the point I want to add already exists | ||
| if (quadTree->quadNode->imagePoints.TL.x == node->imagePoints.TL.x && quadTree->quadNode->imagePoints.TL.y == node->imagePoints.TL.y) { | ||
| removeIfExist(quadTree->quadNode->LinkedList_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enter to this function(remove if exsit) all the logic
Storage/DiskManagment.c
Outdated
| //If the point I want to add already exists | ||
| if (quadTree->quadNode->imagePoints.TL.x == node->imagePoints.TL.x && quadTree->quadNode->imagePoints.TL.y == node->imagePoints.TL.y) { | ||
| removeIfExist(quadTree->quadNode->LinkedList_ptr); | ||
| QuadNode_t* saveToRemove = quadTree->quadNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allocate all var at the begining
Storage/DiskManagment.c
Outdated
| // Checks whether to enter the TL | ||
| if (existingNode->imagePoints.TL.x <= midX && existingNode->imagePoints.TL.y <= midY) | ||
| { | ||
| if (quadTree->topLeftTree == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove and assert
Storage/DiskManagment.c
Outdated
| { | ||
| if (quadTree->topLeftTree == NULL) | ||
| { | ||
| quadTree->topLeftTree = createQuadTree(quadTree->TL, CreatePoint(midX, midY)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add function that do switch from where
Storage/DiskManagment.c
Outdated
| QuadNode_t* existingNode = quadTree->quadNode; | ||
| quadTree->quadNode = NULL; | ||
| // Checks whether to enter the TL | ||
| if (existingNode->imagePoints.TL.x <= midX && existingNode->imagePoints.TL.y <= midY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the if to new func for checking from where the point came.
Storage/DiskManagment.c
Outdated
| free(saveToRemove); | ||
| return; | ||
| } | ||
| else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the else
Storage/DiskManagment.c
Outdated
| if (existingNode->imagePoints.TL.x <= midX && existingNode->imagePoints.TL.y > midY) | ||
| { | ||
| if (quadTree->botLeftTree == NULL) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add new func that create quadTree and init all parms used at all the if's
| return; | ||
| } | ||
| //The place I want to enter is taken | ||
| if (quadTree->quadNode != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to export to inline function and the name's func will explain what the if check
Storage/DiskManagment.c
Outdated
| int midX = (quadTree->TL.x + quadTree->BR.x) / 2; | ||
| int midY = (quadTree->TL.y + quadTree->BR.y) / 2; | ||
| //The recursion breakpoint when the node found his correct place and everything is NULL | ||
| if (quadTree->quadNode == NULL && quadTree->topLeftTree == NULL && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export to inline function
Storage/DiskManagment.c
Outdated
| free(saveToRemove); | ||
| return; | ||
| } | ||
| else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if ()*4
No description provided.