Viva 2.0 Flashcards

1
Q

Explain what is meant by encapsulation.

A

Encapsulation is an OOP concept that combines similar data and functions into a single unit called a class. By doing so the data is protected from change making it easier to reuse.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain what is meant by inheritance.

A

Inheritance is the production of a new class that has been derived from an existing/base class. The derived class inherits features from the base class as well as having its own additional features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain what is meant by polymorphism.

A

It is the ability of a function or object to perform in different ways depending on how it is used. /this is done by defining a method in a superclass but it can be overwritten by a subclass. This allows different objects to behave differently even though they are the same type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are templates?

A

A template is a generic blueprint for creating objects or functions. It can be used to create different types of objects or functions without having to rewrite the code for each type. This can save time and effort for making programs more efficient.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the procedure you would follow to obtain a copy of an online Git repository, make some changes, and then update the online repository with your changes.

A

First you would git clone the online repository with the git repo URL, then make your changes to the file. Then you would add . and commit with a message. Finally you would git push which pushes all your changes to the online repo.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a fork on Git, how do you create a fork and obtain a local copy of the fork?

A

A fork on Git is a copy of a repository that is owned by another user. Forking a repository allows you to make changes to the code without affecting the original repository. You can then create a pull request to merge your changes back into the original repository. To create a fork, you can click the fork button on the GitHub repository you want to fork, this will be created in your GitHub account and a local copy of this fork can be obtained by using git clone followed by URL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are Github actions and how can they be used?

A

Github actions is a feature that allow users to automate, customise and execute workflows based on predefined events. Some examples of their usage are issues and pull request management, publish packages or in our case the doxygen pages build and deployment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between and pull and a fetch operation in Git?

A

Git fetch only downloads new changes from the remote repo and leaves you to manually merge them, whereas git pull downloads all new changes and auto merges them with your local branch. Git pull is just the two commands git fetch and git merged combined into one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain the differences between static and dynamic libraries.

A

Static libraries are compiled into the executable file at compile time and are easier to distribute but make larger executable files. Dynamic libraries on the other hand are linked to the program at runtime .This mean that the code from the dynamic library is not merged with the code from the program but is instead loaded into memory when the program is run. Dynamic libraries are typically used for code that is expected to change frequently, as updating a dynamic library does not require recompiling the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the steps involved in building a program using command line compiler tools.

A

install the compiler for the programming language that you want to use
create a directory to store your project files. This directory will contain your source code files, as well as any other files that are needed to build the program.
write your source code. The source code is the text that tells the compiler how to build your program.
compile it.
Next, the object files are linked. Object files are the compiled versions of the source code. Linking them combines the object files into a single executable file.
Lastly you can now run the program by typing the name of the executable file at the command prompt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain how user actions, such as the click of a button, can be linked to useful code in a Qt application.

A
  • Qt uses a signal and slot mechanism to establish connections between the user interface elements, and the code that handles their actions.
    1) A signal is first emitted by an object to indicate that an event or action has occurred. For example, a QPushButton object emits a signal called ‘clicked()’ when it is clicked.
    2) A slot function then gets executed in response to that signal. You must define slots in your code that correspond to the different signals.
    3) Next the signals and slots are linked by using the ‘connect()’ function.
    4) Once the signals and slots are connected, then the event loop detects this signal and triggers the connected slot, allowing associated code to execute.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

You have created a Qt application with a GUI that was designed in Qt designer, the GUI contains a checkbox. How might you determine the state of the checkbox from within the C++ code of your application

A

1) First is to assign an object name to the checkbox
2) next is to then access the checkbox in the C++ code by using the ‘findChild()’ functions, which searches for a child widget with the specified object name within a parent widget.
3) Then you can write an if statement to see if the checkbox is checked by using the ‘isChecked()’ function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

You have an application with a Qt based GUI that includes toolbars and menus with icons. How might these icons be stored/accessed by the application when it runs?

A

There are two ways to store/access these icons when the application is run.

The first is using the resource files. Qt provides a resource system that allows you to bundle icons, and other resources, directly into the application executable. The icons can be accessed at runtime using the resource system’s prefix notation and ‘QIcon icon()’.

The second is by loading the files externally. The icons can be stored as separate files on the disk, still using the same ‘QIcon icon()’ function to load them up at runtime using their file paths.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

An application linked with Qt compiles without any errors or warnings but when you try to run it from within Visual Studio it will not launch. Why might this be?

A

1) missing or incorrect DLLs (Dynamic link libraries).
3) Qt applications may also require additional resources or files to run correctly.
4) There might be issues with the runtime environment, such as missing system dependencies or conflicting settings, that prevent the application from running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What VTK classes must be used to render a simple object, e.g. a cube, in an application?

A

To create a cube, you’ll need vtkCubeSource, the class to create a cube, vtkPolyDataMapper, a class which maps a vtkPolyData object to a graphics primitive, vtkActor, a class that represents an actor in the scene, vtkRenderer, a class that represents a 3D rendering window, and vtkRenderWindowInteractor, a class that allows the user to interact with the rendered scene.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a vtkSmartPointer (or a smart pointer in general)?

A

A smart pointer is a type of pointer that automatically manages the memory for the object it points to. This means that the smart pointer will automatically delete the object when it is no longer needed, preventing memory leaks. The vtkSmartPointer is a specific type of smart pointer that is used in the VTK library. It is a template class, which means that i can be used to point to objects of any type.

17
Q

Explain how filters work in VTK.

A

Filters are VTK components that receive data from other components, modify the data in some way, and then deliver the modified data as output to be used by other components. Filters are connected in a pipeline, with the output of one filter being the input to another filter. This allows for complex operations to be performed on data by chaining together multiple filters.

18
Q

What is a thread and why are threads required for your VR implementation?

A

A thread is a lightweight process that can run concurrently with other threads. Threads are required for VR implementation because they allow the different parts of the VR experience to run simultaneously. An example of multiple threads running in this project is one thread running the skybox, one thread is running the object, and another thread is updating the physics of the object. Threads allow for a smooth and responsive experience. In terms of multitasking and performance and responsiveness of the system, VR applications typically involve multiple tasks that need to be performed simultaneously or in parallel. By using multiple threads, these tasks can be executed concurrently, allowing for the VR system to efficiently perform various operations at the same time.

19
Q

Explain, in a way suitable for a non-expert, how the VR systems in the labs work.

A

VR (Virtual Reality) enables the user to immerse themselves in a virtual environment. There are multiple parts to a VR system, the first being the headset. This goes over the users head and provides a display to the users eyes individually. Inside this headset there are motion sensors that track the users movements, this enables the simulation to immerse the user as when they turn their head the simulation moves with them. Then there are two controllers for the user, this enables them to interact with their virtual environment through the use of buttons and hand gestures. There are sensors throughout the lab that also track the user to provide a better understanding of their positioning. Lastly a high performance computer is required to run the software as it needs to render the simulation live and react to the users movements.

20
Q

What is NSIS and how is it used from within CMake

A

NSIS (Nullsoft Scriptable Install System) is a scriptable installer for windows.
NSIS can be used to install software, create shortcuts, and configure settings.
By combining CMake and NSIS, you can streamline the process of building your software and creating a Windows installer.
CMake handles the generation of platform-specific build files
NSIS takes care of packaging your software into a professional-looking installer package with customizable options.